-
- All Known Implementing Classes:
AbstractObjectEncoderFactory
,AnnotationEncoderFactory
,ItemSetEncoderFactory
public interface EncoderFactory
An interface defining a factory that provides an encoder and decoder for a particular class or set of classes. This factory is utilized by the encoding/decoding framework to extend it's functionality. A class that wishes to be serialized properly must define a factory for the class and register the factory.NOTE: Implementations should extend
AbstractObjectEncoderFactory
factory rather than directly implementing EncoderFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isFactoryForType(TokenType type)
Determine if this factory supports the given class type.TokenDecoder
newDecoder(TokenType type)
Create a newdecoder
instance for the given type.TokenEncoder
newEncoder(TokenType type)
Create a newencoder
instance for the given type.
-
-
-
Method Detail
-
isFactoryForType
boolean isFactoryForType(TokenType 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
-
newEncoder
TokenEncoder newEncoder(TokenType type)
Create a newencoder
instance for the given type. The type is specified to allow a single factory to serve multiple types.- Parameters:
type
- the type which is to be encoded- Returns:
- a new encoder instance
-
newDecoder
TokenDecoder newDecoder(TokenType type)
Create a newdecoder
instance for the given type. The type is specified to allow a single factory to serve multiple types.- Parameters:
type
- the type which is to be decoded- Returns:
- a new decoder instance
-
-