public class YAMLAnchorReplayingParser extends YAMLParser
Note: this overwrites the getEvent() since the base `super.nextToken()` manages to much state and it seems to be much simpler to re-emit the events.
YAMLParser.Feature| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_ANCHORS
the maximum limit of anchors to remember
|
static int |
MAX_EVENTS
the maximum number of events that can be replayed
|
static int |
MAX_MERGES
the maximum limit of merges to follow
|
static int |
MAX_REFS
the maximum limit of references to remember
|
_cfgEmptyStringsToNull, _cleanedTextValue, _currentAnchor, _currentFieldName, _currentIsAlias, _emittingSyntheticEmptyObject, _formatFeatures, _hasContent, _lastEvent, _lastTagEvent, _objectCodec, _reader, _textValue, _yamlParser, _yamlResolver_binaryValue, _byteArrayBuilder, _closed, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal, JSON_READ_CAPABILITIES_currToken, _lastClearedToken, _streamReadConstraints, _tokenCount, _trackMaxTokenCount, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN| Constructor and Description |
|---|
YAMLAnchorReplayingParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int parserFeatures,
int formatFeatures,
org.yaml.snakeyaml.LoaderOptions loaderOptions,
com.fasterxml.jackson.core.ObjectCodec codec,
Reader reader) |
| Modifier and Type | Method and Description |
|---|---|
protected org.yaml.snakeyaml.events.Event |
filterEvent(org.yaml.snakeyaml.events.Event event) |
protected org.yaml.snakeyaml.events.Event |
getEvent()
Since the parserImpl cannot be replaced allow subclasses to at least be able to
influence the events being consumed.
|
protected org.yaml.snakeyaml.events.Event |
trackDepth(org.yaml.snakeyaml.events.Event event) |
_closeInput, _decodeNumberIntBinary, _decodeNumberIntHex, _decodeNumberIntOctal, _decodeNumberScalar, _decodeScalar, _locationFor, _matchYAMLBoolean, _parseIntValue, _parseNumericValue, canReadObjectId, canReadTypeId, configure, currentLocation, currentName, currentTokenLocation, disable, enable, getCodec, getCurrentAnchor, getCurrentLocation, getCurrentName, getEmbeddedObject, getFormatFeatures, getNumberTypeFP, getNumberValueDeferred, getObjectId, getReadCapabilities, getText, getText, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, getTypeId, hasTextCharacters, isCurrentAlias, isEnabled, nextToken, overrideFormatFeatures, readBinaryValue, requiresCustomCodec, setCodec, version_checkStdFeatureChanges, _contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _finishString, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _getSourceReference, _growNameDecodeBuffer, _handleBase64MissingPadding, _handleEOF, _handleUnrecognizedCharacterEscape, _releaseBuffers, _reportExtraEndMarker, _reportMismatchedEndMarker, _reportTooLongIntegral, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, assignCurrentValue, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, createChildArrayContext, createChildObjectContext, currentValue, disable, enable, getBigIntegerValue, getBinaryValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueExact, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isClosed, isNaN, loadMore, loadMoreGuaranteed, overrideCurrentName, overrideStdFeatures, reportInvalidBase64Char, reportInvalidBase64Char, reset, resetAsNaN, resetFloat, resetInt, setFeatureMask_ascii, _asciiBytes, _constructError, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapError, clearCurrentToken, currentToken, currentTokenCount, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren, streamReadConstraints_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canUseSchema, configure, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getInputSource, getNonBlockingInputFeeder, getSchema, getShortValue, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, setCurrentValue, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchemapublic static final int MAX_EVENTS
public static final int MAX_ANCHORS
public static final int MAX_MERGES
public static final int MAX_REFS
public YAMLAnchorReplayingParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int parserFeatures,
int formatFeatures,
org.yaml.snakeyaml.LoaderOptions loaderOptions,
com.fasterxml.jackson.core.ObjectCodec codec,
Reader reader)
protected org.yaml.snakeyaml.events.Event trackDepth(org.yaml.snakeyaml.events.Event event)
protected org.yaml.snakeyaml.events.Event filterEvent(org.yaml.snakeyaml.events.Event event)
protected org.yaml.snakeyaml.events.Event getEvent()
throws IOException
YAMLParserA particular use case is working around the lack of anchor and alias support to emit additional events.
NOTE: since 2.18, declared to throw IOException to allow sub-classes
to do so.
getEvent in class YAMLParserIOExceptionCopyright © 2026 FasterXML. All rights reserved.