Package fr.dyade.aaa.common.encoding
Class EncodableFactoryRepository
- java.lang.Object
-
- fr.dyade.aaa.common.encoding.EncodableFactoryRepository
-
public class EncodableFactoryRepository extends Object
Repository for every encodable objects factory. The identifier of a factory must be the concatenation of two short integers: the first one identifies the area of the class; the second one identifies the class. The area of the encodable objects defined in this encoding framework is 0.
-
-
Field Summary
Fields Modifier and Type Field Description private static intCLASS_ID_AREAstatic intENCODABLE_INTEGER_CLASS_IDstatic intENCODED_STRING_CLASS_IDstatic intENCODED_STRING_LIST_CLASS_IDstatic intPROPERTIES_CLASS_IDprivate static Hashtable<Integer,EncodableFactory>repositorystatic intSERIALIZABLE_WRAPPER_CLASS_IDstatic intSTRING_PAIR_CLASS_ID
-
Constructor Summary
Constructors Constructor Description EncodableFactoryRepository()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EncodableFactorygetFactory(Integer classId)Returns the specified factory.static voidputFactory(Integer classId, EncodableFactory factory)Registers a factory.
-
-
-
Field Detail
-
CLASS_ID_AREA
private static final int CLASS_ID_AREA
- See Also:
- Constant Field Values
-
ENCODED_STRING_CLASS_ID
public static final int ENCODED_STRING_CLASS_ID
- See Also:
- Constant Field Values
-
SERIALIZABLE_WRAPPER_CLASS_ID
public static final int SERIALIZABLE_WRAPPER_CLASS_ID
- See Also:
- Constant Field Values
-
STRING_PAIR_CLASS_ID
public static final int STRING_PAIR_CLASS_ID
- See Also:
- Constant Field Values
-
PROPERTIES_CLASS_ID
public static final int PROPERTIES_CLASS_ID
- See Also:
- Constant Field Values
-
ENCODED_STRING_LIST_CLASS_ID
public static final int ENCODED_STRING_LIST_CLASS_ID
- See Also:
- Constant Field Values
-
ENCODABLE_INTEGER_CLASS_ID
public static final int ENCODABLE_INTEGER_CLASS_ID
- See Also:
- Constant Field Values
-
repository
private static Hashtable<Integer,EncodableFactory> repository
-
-
Method Detail
-
getFactory
public static EncodableFactory getFactory(Integer classId)
Returns the specified factory.- Parameters:
classId- the identifier of the factory- Returns:
- the specified factory
-
putFactory
public static void putFactory(Integer classId, EncodableFactory factory)
Registers a factory.- Parameters:
classId- the identifier of the factoryfactory- the factory to register
-
-