-
- All Known Implementing Classes:
AbstractObjectEncoderFactory,AnnotationEncoderFactory,ItemSetEncoderFactory
public interface EncoderFactoryAn 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
AbstractObjectEncoderFactoryfactory rather than directly implementing EncoderFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisFactoryForType(TokenType type)Determine if this factory supports the given class type.TokenDecodernewDecoder(TokenType type)Create a newdecoderinstance for the given type.TokenEncodernewEncoder(TokenType type)Create a newencoderinstance 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 newencoderinstance 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 newdecoderinstance 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
-
-