Class AbstractObjectEncoderFactory

java.lang.Object
com.pervasive.datarush.encoding.binary.AbstractObjectEncoderFactory
All Implemented Interfaces:
EncoderFactory
Direct Known Subclasses:
AnnotationEncoderFactory, ItemSetEncoderFactory

public abstract class AbstractObjectEncoderFactory extends Object implements EncoderFactory
Base implementation of EncoderFactory for customizing the encoding/decoding of ObjectTokenType. To support a new object type, extend this class rather than implementing EncoderFactory directly.
  • Constructor Details

    • AbstractObjectEncoderFactory

      public AbstractObjectEncoderFactory()
  • Method Details

    • isFactoryForType

      public final boolean isFactoryForType(TokenType type)
      Description copied from interface: EncoderFactory
      Determine if this factory supports the given class type. A factory may support many types.
      Specified by:
      isFactoryForType in interface EncoderFactory
      Parameters:
      type - the type to check
      Returns:
      true if supported; false otherwise
    • newDecoder

      public final TokenDecoder newDecoder(TokenType type)
      Description copied from interface: EncoderFactory
      Create a new decoder instance for the given type. The type is specified to allow a single factory to serve multiple types.
      Specified by:
      newDecoder in interface EncoderFactory
      Parameters:
      type - the type which is to be decoded
      Returns:
      a new decoder instance
    • newEncoder

      public TokenEncoder newEncoder(TokenType type)
      Description copied from interface: EncoderFactory
      Create a new encoder instance for the given type. The type is specified to allow a single factory to serve multiple types.
      Specified by:
      newEncoder in interface EncoderFactory
      Parameters:
      type - the type which is to be encoded
      Returns:
      a new encoder instance
    • isFactoryForType

      protected abstract boolean isFactoryForType(Class<?> type)
      Determine if this factory supports the given class type. A factory may support many types.
      Parameters:
      type - the type to check
      Returns:
      true if supported; false otherwise
    • newDecoder

      protected abstract TokenDecoder newDecoder(Class<?> type)
      Create a new decoder instance for the given type. The type is specified to allow a single factory to serve multiple types.
      Parameters:
      type - the class which is to be decoded
      Returns:
      a new encoder instance
    • newEncoder

      protected abstract TokenEncoder newEncoder(Class<?> type)
      Create a new encoder instance for the given type. The type is specified to allow a single factory to serve multiple types.
      Parameters:
      type - the class which is to be decoded
      Returns:
      a new decoder instance