Class AbstractUnmarshaller

All Implemented Interfaces:
Closeable, DataInput, ObjectInput, AutoCloseable, ByteInput, Unmarshaller

public abstract class AbstractUnmarshaller extends AbstractObjectInput implements Unmarshaller
An abstract implementation of the Unmarshaller interface. Most of the write methods delegate directly to the current data output.
  • Field Details

    • classExternalizerFactory

      protected final ClassExternalizerFactory classExternalizerFactory
      The configured class externalizer factory.
    • streamHeader

      protected final StreamHeader streamHeader
      The configured stream header.
    • classResolver

      protected final ClassResolver classResolver
      The configured class resolver.
    • objectResolver

      protected final ObjectResolver objectResolver
      The configured object resolver.
    • objectPreResolver

      protected final ObjectResolver objectPreResolver
      The configured object pre resolver.
    • classTable

      protected final ClassTable classTable
      The configured class table.
    • objectTable

      protected final ObjectTable objectTable
      The configured object table.
    • exceptionListener

      protected final ExceptionListener exceptionListener
      The configured exception listener.
    • serializabilityChecker

      protected final SerializabilityChecker serializabilityChecker
      The configured serializability checker.
    • unmarshallingFilter

      protected final UnmarshallingObjectInputFilter unmarshallingFilter
      The configured unmarshalling filter
    • configuredVersion

      protected final int configuredVersion
      The configured version.
  • Constructor Details

    • AbstractUnmarshaller

      protected AbstractUnmarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration)
      Construct a new unmarshaller instance.
      Parameters:
      marshallerFactory - the marshaller factory
      configuration -
  • Method Details

    • start

      public void start(ByteInput byteInput) throws IOException
      Start reading from the given input. The internal buffer is discarded.
      Specified by:
      start in interface Unmarshaller
      Overrides:
      start in class SimpleDataInput
      Parameters:
      byteInput - the new input from which to read
      Throws:
      IOException - not thrown by this implementation, but may be overridden to be thrown if a problem occurs
    • finish

      public void finish() throws IOException
      Finish reading from the current input. The internal buffer is discarded, not flushed.
      Specified by:
      finish in interface Unmarshaller
      Overrides:
      finish in class SimpleDataInput
      Throws:
      IOException - not thrown by this implementation, but may be overridden to be thrown if a problem occurs
    • filterCheck

      protected final void filterCheck(Class<?> unmarshallClass, long arrayLength, long depth, long references, long streamBytes) throws InvalidClassException
      Throws:
      InvalidClassException
    • setObjectInputStreamFilter

      protected static void setObjectInputStreamFilter(ObjectInputStream ois, UnmarshallingObjectInputFilter unmarshallingFilter)
      Creates an ObjectInputFilter adapter to given UnmarshallingFilter, and sets the filter to given ObjectInputStream.

      This essentially delegates the filtering functionality to underlying ObjectInputStream.

      Parameters:
      ois - ObjectInputStream instance to set the filter to.
      unmarshallingFilter - UnmarshallingObjectInputFilter instance to delegate filtering decisions to.