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

public class YAMLAnchorReplayingParser extends YAMLParser
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    the maximum limit of anchors to remember
    static final int
    the maximum number of events that can be replayed
    static final int
    the maximum limit of merges to follow
    static final int
    the maximum limit of references to remember

    Fields 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, _tokenInputTotal

    Fields 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_DEFAULTS

    Fields inherited from class tools.jackson.core.JsonParser

    DEFAULT_READ_CAPABILITIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    protected org.snakeyaml.engine.v2.events.Event
    filterEvent(org.snakeyaml.engine.v2.events.Event event)
     
    protected org.snakeyaml.engine.v2.events.Event
     
    protected void
    recordEvent(org.snakeyaml.engine.v2.events.Event event)
     
    protected org.snakeyaml.engine.v2.events.Event
    trackDepth(org.snakeyaml.engine.v2.events.Event event)
     

    Methods 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, resetInt

    Methods 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, streamReadFeatures

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_EVENTS

      public static final int MAX_EVENTS
      the maximum number of events that can be replayed
      See Also:
    • MAX_ANCHORS

      public static final int MAX_ANCHORS
      the maximum limit of anchors to remember
      See Also:
    • MAX_MERGES

      public static final int MAX_MERGES
      the maximum limit of merges to follow
      See Also:
    • MAX_REFS

      public static final int MAX_REFS
      the 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:
      nextEvent in class YAMLParser