- 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
Modifier and TypeMethodDescriptionbooleanisFactoryForType(TokenType type) Determine if this factory supports the given class type.newDecoder(TokenType type) Create a newdecoderinstance for the given type.newEncoder(TokenType type) Create a newencoderinstance for the given type.
-
Method Details
-
isFactoryForType
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
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
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
-