JsonParser implementation used to expose YAML documents
in form that allows other Jackson functionality to process YAML content,
such as binding POJOs to and from it, and building tree representations.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | YAMLParser.
Enumeration that defines all togglable features for YAML parsers. |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| protected String | _cleanedTextValue
For some tokens (specifically, numbers), we'll have cleaned up version, mostly free of underscores |
| protected String | _currentAnchor
Anchor for the value that parser currently points to: in case of structured types, value whose first token current token is. |
| protected String | _currentFieldName
Let's also have a local copy of the current field name |
| protected boolean | _currentIsAlias
Flag that is set when current token was derived from an Alias (reference to another value's anchor) |
| protected int | |
| protected Event | _lastEvent
Keep track of the last event read, to get access to Location info |
| protected Event | _lastTagEvent
To keep track of tags ("type ids"), need to either get tags for all
events, or, keep tag of relevant event that might have it: this is
different from |
| protected ObjectCodec | _objectCodec
Codec used for data binding when (if) requested. |
| protected final Reader | |
| protected String | _textValue
We need to keep track of text values. |
| protected final ParserImpl | |
| protected final Resolver |
| Access | Constructor and Description |
|---|---|
| public | YAMLParser(IOContext ctxt, BufferRecycler br, int parserFeatures, int formatFeatures, ObjectCodec codec, Reader reader)
Deprecated
since 2.14, use other constructor
|
| public | YAMLParser(IOContext ctxt, int parserFeatures, int formatFeatures, LoaderOptions loaderOptions, ObjectCodec codec, Reader reader)
|
| protected | YAMLParser(IOContext ctxt, int parserFeatures, int formatFeatures, ObjectCodec codec, Reader reader, ParserImpl yamlParser)
Constructor to overload by custom parser sub-classes that want to replace
|
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| private JsonToken | |
| private JsonToken | _cleanYamlInt(String str)
Helper method used to clean up YAML integer value so it can be parsed using standard JDK classes. |
| protected void | |
| private BigInteger | |
| private JsonToken | |
| private JsonToken | |
| private int | |
| private long | |
| protected JsonToken | |
| protected JsonToken | |
| protected JsonToken | |
| protected JsonToken | |
| protected JsonToken | |
| protected JsonLocation | |
| protected Boolean | |
| protected int | |
| protected void | _parseNumericValue(int
Numeric type that we will immediately need, if any;
mostly necessary to optimize handling of floating point numbers expType)Overrides com. Method that will parse actual numeric value out of a syntactically valid number value. |
| private <T> T | |
| public boolean | canReadObjectId()
Overrides com. Introspection method that may be called to see if the underlying data format supports some kind of Object Ids natively (many do not; for example, JSON doesn't). |
| public boolean | canReadTypeId()
Overrides com. Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't). |
| public JsonParser | configure(YAMLParser.
Method for enabling or disabling specified CSV feature
(check |
| public JsonLocation | currentLocation()
Overrides com. Method that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes. |
| public String | currentName()
Overrides com. Method that can be called to get the name associated with
the current token: for |
| public JsonLocation | currentTokenLocation()
Overrides com. Method that return the starting location of the current (most recently returned) token; that is, the position of the first input unit (character or byte) from input that starts the current token. |
| public JsonParser | disable(YAMLParser.
Method for disabling specified CSV feature
(check |
| public JsonParser | enable(YAMLParser.
Method for enabling specified CSV feature
(check |
| public ObjectCodec | getCodec()
Implements abstract com. Accessor for |
| public String | getCurrentAnchor()
Deprecated
Since 2.3 (was added in 2.1) -- use
getObjectId instead
Method that can be used to check if the current token has an associated anchor (id to reference via Alias) |
| public JsonLocation | getCurrentLocation()
Overrides com.
Deprecated
Method that returns location of the last processed character; usually for error reporting purposes |
| public String | getCurrentName()
Overrides com.
Deprecated
Method that can be called to get the name associated with the current event. |
| public Object | getEmbeddedObject()
Overrides com. Accessor that can be called if (and only if) the current token
is |
| protected Event | getEvent()
Since the parserImpl cannot be replaced allow subclasses to at least be able to influence the events being consumed. |
| public int | getFormatFeatures()
Overrides com. Bulk access method for getting state of all |
| public JsonParser. | getNumberTypeFP()
Overrides com. If current token is of type
|
| public Object | getNumberValueDeferred()
Overrides com. Method similar to |
| public String | getObjectId()
Overrides com. Method that can be called to check whether current token (one that was just read) has an associated Object id, and if so, return it. |
| public JacksonFeatureSet | getReadCapabilities()
Overrides com. Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly). |
| public String | getText()
Implements abstract com. Method for accessing textual representation of the current token;
if no current token (before first call to |
| public int | getText(Writer
Writer to write textual content to writer)Overrides com. Method to read the textual representation of the current token in chunks and pass it to the given Writer. |
| public char[] | getTextCharacters()
Implements abstract com. Method similar to |
| public int | getTextLength()
Implements abstract com. Accessor used with |
| public int | getTextOffset()
Implements abstract com. Accessor used with |
| public JsonLocation | getTokenLocation()
Overrides com.
Deprecated
Method that return the starting location of the current token; that is, position of the first character from input that starts the current token. |
| public String | getTypeId()
Overrides com. Method that can be called to check whether current token (one that was just read) has an associated type id, and if so, return it. |
| public boolean | hasTextCharacters()
Overrides com. Method that can be used to determine whether calling of
|
| public boolean | isCurrentAlias()
Method that can be used to check whether current token was created from YAML Alias token (reference to an anchor). |
| public boolean | |
| public JsonToken | nextToken()
Implements abstract com. Main iteration method, which will advance stream enough to determine type of the next token, if any. |
| public JsonParser | overrideFormatFeatures(int
Bit mask of set/clear state for features to change values, int Bit mask of features to change mask)Overrides com. Bulk set method for (re)setting states of |
| public int | readBinaryValue(Base64Variant
base64 variant to use b64variant, OutputStream Output stream to use for passing decoded binary data out)Overrides com. Similar to |
| public boolean | requiresCustomCodec()
Overrides com. Method that can be called to determine if a custom
|
| public void | setCodec(ObjectCodec
Codec to assign, if any; c)null if noneImplements abstract com. Setter that allows defining |
| public Version | version()
Overrides com. Implements com. Accessor for getting version of the core package, given a parser instance. |