Class ObjectFactory<B>
java.lang.Object
org.exoplatform.commons.serialization.api.factory.ObjectFactory<B>
- Type Parameters:
B- the paraemter type of the base type
- Direct Known Subclasses:
DefaultObjectFactory
A factory that creates instance of a type.
- Version:
- $Revision$
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <S extends B>
Screate(Class<S> type, Map<FieldModel<? super S, ?>, ?> state) Instantiate an object based on the provided type.
-
Constructor Details
-
ObjectFactory
public ObjectFactory()
-
-
Method Details
-
create
public abstract <S extends B> S create(Class<S> type, Map<FieldModel<? super S, ?>, throws CreateException?> state) Instantiate an object based on the provided type. The implementor should take care of configuring the state of the returned objet with the provided state map argument.- Type Parameters:
S- the parameter type of the sub type of the base type- Parameters:
type- the typestate- the state- Returns:
- the S instance
- Throws:
CreateException- anything wrong that happened during instance creation
-