Module datarush.library
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 ofEncoderFactory
for customizing the encoding/decoding ofObjectTokenType
. To support a new object type, extend this class rather than implementingEncoderFactory
directly.
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectEncoderFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isFactoryForType(TokenType type)
Determine if this factory supports the given class type.protected abstract boolean
isFactoryForType(Class<?> type)
Determine if this factory supports the given class type.TokenDecoder
newDecoder(TokenType type)
Create a newdecoder
instance for the given type.protected abstract TokenDecoder
newDecoder(Class<?> type)
Create a new decoder instance for the given type.TokenEncoder
newEncoder(TokenType type)
Create a newencoder
instance for the given type.protected abstract TokenEncoder
newEncoder(Class<?> type)
Create a new encoder instance for the given type.
-
-
-
Method Detail
-
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 interfaceEncoderFactory
- 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 newdecoder
instance for the given type. The type is specified to allow a single factory to serve multiple types.- Specified by:
newDecoder
in interfaceEncoderFactory
- 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 newencoder
instance for the given type. The type is specified to allow a single factory to serve multiple types.- Specified by:
newEncoder
in interfaceEncoderFactory
- 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
-
-