Skip to content

Commit 29c7b71

Browse files
committed
...
1 parent 481afc0 commit 29c7b71

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/main/java/com/fasterxml/jackson/core/JsonToken.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public enum JsonToken
136136
/**
137137
* @param token representation for this token, if there is a
138138
* single static representation; null otherwise
139+
* @param id Numeric id from {@link JsonTokenId}
139140
*/
140141
JsonToken(String token, int id)
141142
{
@@ -172,14 +173,21 @@ public enum JsonToken
172173
public final char[] asCharArray() { return _serializedChars; }
173174
public final byte[] asByteArray() { return _serializedBytes; }
174175

176+
/**
177+
* @return {@code True} if this token is {@code VALUE_NUMBER_INT} or {@code VALUE_NUMBER_FLOAT},
178+
* {@code false} otherwise
179+
*/
175180
public final boolean isNumeric() { return _isNumber; }
176181

177182
/**
178183
* Accessor that is functionally equivalent to:
179184
* <code>
180185
* this == JsonToken.START_OBJECT || this == JsonToken.START_ARRAY
181186
* </code>
182-
*
187+
*
188+
* @return {@code True} if this token is {@code START_OBJECT} or {@code START_ARRAY},
189+
* {@code false} otherwise
190+
*
183191
* @since 2.3
184192
*/
185193
public final boolean isStructStart() { return _isStructStart; }
@@ -189,16 +197,28 @@ public enum JsonToken
189197
* <code>
190198
* this == JsonToken.END_OBJECT || this == JsonToken.END_ARRAY
191199
* </code>
200+
*
201+
* @return {@code True} if this token is {@code END_OBJECT} or {@code END_ARRAY},
202+
* {@code false} otherwise
192203
*
193204
* @since 2.3
194205
*/
195206
public final boolean isStructEnd() { return _isStructEnd; }
196207

197208
/**
198209
* Method that can be used to check whether this token represents
199-
* a valid non-structured value. This means all tokens other than
200-
* Object/Array start/end markers all field names.
210+
* a valid non-structured value. This means all {@code VALUE_xxx} tokens;
211+
* excluding {@code START_xxx} and {@code END_xxx} tokens as well
212+
* {@code FIELD_NAME}.
213+
*
214+
* @return {@code True} if this token is a scalar value token (one of
215+
* {@code VALUE_xxx} tokens), {@code false} otherwise
201216
*/
202217
public final boolean isScalarValue() { return _isScalar; }
218+
219+
/**
220+
* @return {@code True} if this token is {@code VALUE_TRUE} or {@code VALUE_FALSE},
221+
* {@code false} otherwise
222+
*/
203223
public final boolean isBoolean() { return _isBoolean; }
204224
}

0 commit comments

Comments
 (0)