T
- the supported object typeD
- the supported definition typepublic abstract class AbstractObjectFactory<T,D extends ObjectDefinition<? extends T>> extends Object
ObjectDefinition
ies available for the
supported object type and its sub-types.Constructor and Description |
---|
AbstractObjectFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
<X extends T> |
asPair(X object)
Get the object type identifier and the string representation of the
object.
|
<X extends T> |
asString(X object)
Represent the given object as a definition string, so that it can be used
to again create an object instance using
parse(String) . |
T |
from(String typeId,
String value)
Recreate an object from type identifier and string representation as
retrieved using
asPair(Object) . |
protected abstract List<D> |
getDefinitions()
Get all available definitions compatible with the supported type.
|
T |
parse(String value)
Parse the given definition string and create a corresponding object.
|
protected abstract List<D> getDefinitions()
public <X extends T> String asString(X object)
parse(String)
.X
- the object type, an ObjectDefinition
supporting this
type must be availableobject
- the object to create a string representation fornull
if
no corresponding ObjectDefinition
is availablegetDefinitions()
public <X extends T> Pair<String,String> asPair(X object)
asString(Object)
.X
- the object type, an ObjectDefinition
supporting this
type must be availableobject
- the object to create a string representation fornull
if no corresponding
ObjectDefinition
is availablegetDefinitions()
public T parse(String value)
value
- the definition string to parsenull
public T from(String typeId, String value)
asPair(Object)
.typeId
- the type identifiervalue
- the object string representationnull
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a