Class DecorableTSFactory

java.lang.Object
tools.jackson.core.TokenStreamFactory
tools.jackson.core.base.DecorableTSFactory
All Implemented Interfaces:
Serializable, Snapshottable<TokenStreamFactory>, Versioned
Direct Known Subclasses:
BinaryTSFactory, TextualTSFactory

public abstract class DecorableTSFactory extends TokenStreamFactory implements Serializable
Intermediate base TokenStreamFactory implementation that offers support for streams that allow decoration of low-level input sources and output targets.
Since:
3.0
See Also:
  • Field Details

    • _inputDecorator

      protected final InputDecorator _inputDecorator
      Optional helper object that may decorate input sources, to do additional processing on input during parsing.
    • _outputDecorator

      protected final OutputDecorator _outputDecorator
      Optional helper object that may decorate output object, to do additional processing on output during content generation.
    • _generatorDecorators

      protected List<JsonGeneratorDecorator> _generatorDecorators
  • Constructor Details

  • Method Details

    • _copy

      protected static <T> List<T> _copy(List<T> src)
    • getOutputDecorator

      public OutputDecorator getOutputDecorator()
    • getInputDecorator

      public InputDecorator getInputDecorator()
    • getGeneratorDecorators

      public List<JsonGeneratorDecorator> getGeneratorDecorators()
    • _decorate

      protected InputStream _decorate(IOContext ioCtxt, InputStream in) throws JacksonException
      Throws:
      JacksonException
    • _decorate

      protected Reader _decorate(IOContext ioCtxt, Reader in) throws JacksonException
      Throws:
      JacksonException
    • _decorate

      protected DataInput _decorate(IOContext ioCtxt, DataInput in) throws JacksonException
      Throws:
      JacksonException
    • _decorate

      protected OutputStream _decorate(IOContext ioCtxt, OutputStream out) throws JacksonException
      Throws:
      JacksonException
    • _decorate

      protected Writer _decorate(IOContext ioCtxt, Writer out) throws JacksonException
      Throws:
      JacksonException
    • _decorate

      protected JsonGenerator _decorate(JsonGenerator result)
    • _releaseOnFailedConstruction

      protected static void _releaseOnFailedConstruction(IOContext ioCtxt, RuntimeException failure)
      Method called when construction of parser or generator fails: releases IOContext so that BufferRecycler it leased gets returned to the pool. Without this the lease is simply dropped, since context is otherwise only released when parser or generator that owns it gets closed.
      Parameters:
      ioCtxt - Context to release, if any (null if not yet created)
      failure - Failure to add possible secondary failure to, as suppressed
      Since:
      3.1.7
    • _closeOnFailedConstruction

      protected static void _closeOnFailedConstruction(Closeable toClose, RuntimeException failure)
      Method called when construction of parser or generator fails after Jackson has opened source or target itself (from File or Path): closes it so that it does not get leaked. Caller-provided sources and targets are never passed here.
      Parameters:
      toClose - Source/target Jackson opened, if any (null if not yet opened)
      failure - Failure to add possible secondary failure to, as suppressed
      Since:
      3.1.7
    • _closeOnFailedConstruction

      protected static void _closeOnFailedConstruction(Closeable toClose, Closeable rawFallback, RuntimeException failure)
      Variant of _closeOnFailedConstruction(Closeable, RuntimeException) for case where the resource to close may wrap (decorate) the source/target Jackson opened: closing the outermost resource is expected to close what it wraps, so underlying resource is only closed if closing of the outermost one failed.
      Parameters:
      toClose - Outermost source/target to close, if any (null if not yet opened)
      rawFallback - Source/target Jackson opened: closed if, and only if, closing of toClose failed
      failure - Failure to add possible secondary failure to, as suppressed
      Since:
      3.1.7