Package tools.jackson.dataformat.yaml
Class YAMLAnchorReplayingParser
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.core.base.ParserBase
tools.jackson.dataformat.yaml.YAMLParser
tools.jackson.dataformat.yaml.YAMLAnchorReplayingParser
- All Implemented Interfaces:
Closeable,AutoCloseable,tools.jackson.core.Versioned
A parser that remembers the events of anchored parts in yaml and repeats them
to inline these parts when an alias if found instead of only returning an alias.
Note: this overwrites the nextEvent() since the base super.nextToken()
manages too much state, and it seems to be much simpler to re-emit the events.
- Since:
- 2.19
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe maximum limit of anchors to rememberstatic final intthe maximum number of events that can be replayedstatic final intthe maximum limit of merges to followstatic final intthe maximum limit of references to rememberFields inherited from class tools.jackson.dataformat.yaml.YAMLParser
_cfgEmptyStringsToNull, _cleanedTextValue, _currentAnchor, _currentIsAlias, _currentName, _emittingSyntheticEmptyObject, _formatFeatures, _hasContent, _lastEvent, _lastTagEvent, _reader, _streamReadContext, _textValue, _yamlParser, _yamlResolverFields inherited from class tools.jackson.core.base.ParserBase
_binaryValue, _byteArrayBuilder, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotalFields inherited from class tools.jackson.core.base.ParserMinimalBase
_closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _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_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionYAMLAnchorReplayingParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, tools.jackson.core.util.BufferRecycler br, int streamReadFeatures, int formatFeatures, org.snakeyaml.engine.v2.api.LoadSettings loadSettings, Reader reader) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.snakeyaml.engine.v2.events.EventfilterEvent(org.snakeyaml.engine.v2.events.Event event) protected org.snakeyaml.engine.v2.events.Eventprotected voidrecordEvent(org.snakeyaml.engine.v2.events.Event event) protected org.snakeyaml.engine.v2.events.EventtrackDepth(org.snakeyaml.engine.v2.events.Event event) Methods inherited from class tools.jackson.dataformat.yaml.YAMLParser
_closeInput, _decodeNumberIntBinary, _decodeNumberIntHex, _decodeNumberIntOctal, _decodeNumberScalar, _decodeScalar, _locationFor, _matchYAMLBoolean, _parseIntValue, _parseNumericValue, _reportMismatchedEndMarker, assignCurrentValue, canReadObjectId, canReadTypeId, currentLocation, currentName, currentTokenLocation, currentValue, getEmbeddedObject, getNumberValueDeferred, getObjectId, getString, getString, getStringCharacters, getStringLength, getStringOffset, getTypeId, hasStringCharacters, isCurrentAlias, isEnabled, nextToken, readBinaryValue, streamReadCapabilities, streamReadContext, streamReadInputSource, versionMethods inherited from class tools.jackson.core.base.ParserBase
_contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _growNameDecodeBuffer, _handleBase64MissingPadding, _handleEOF, _releaseBuffers, _reportInvalidBase64Char, _reportInvalidBase64Char, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, getBigIntegerValue, getBinaryValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueExact, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isNaN, reset, resetAsNaN, resetFloat, resetIntMethods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getNumberTypeFP, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isClosed, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, skipChildren, streamReadConstraints, streamReadFeaturesMethods inherited from class tools.jackson.core.JsonParser
_constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, getBinaryValue, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nextStringValue, nonBlockingInputFeeder, readBinaryValue, readString, releaseBuffered, releaseBuffered
-
Field Details
-
MAX_EVENTS
public static final int MAX_EVENTSthe maximum number of events that can be replayed- See Also:
-
MAX_ANCHORS
public static final int MAX_ANCHORSthe maximum limit of anchors to remember- See Also:
-
MAX_MERGES
public static final int MAX_MERGESthe maximum limit of merges to follow- See Also:
-
MAX_REFS
public static final int MAX_REFSthe maximum limit of references to remember- See Also:
-
-
Constructor Details
-
YAMLAnchorReplayingParser
public YAMLAnchorReplayingParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, tools.jackson.core.util.BufferRecycler br, int streamReadFeatures, int formatFeatures, org.snakeyaml.engine.v2.api.LoadSettings loadSettings, Reader reader)
-
-
Method Details
-
trackDepth
protected org.snakeyaml.engine.v2.events.Event trackDepth(org.snakeyaml.engine.v2.events.Event event) -
filterEvent
protected org.snakeyaml.engine.v2.events.Event filterEvent(org.snakeyaml.engine.v2.events.Event event) -
recordEvent
protected void recordEvent(org.snakeyaml.engine.v2.events.Event event) -
nextEvent
protected org.snakeyaml.engine.v2.events.Event nextEvent()- Overrides:
nextEventin classYAMLParser
-