Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.util.definition
Class AbstractObjectFactory<T,D extends ObjectDefinition<? extends T>>

java.lang.Object
  extended by eu.esdihumboldt.util.definition.AbstractObjectFactory<T,D>
Type Parameters:
T - the supported object type
D - the supported definition type
Direct Known Subclasses:
CRSDefinitionManager, FilterDefinitionManager, MessageFactory, ReportFactory

public abstract class AbstractObjectFactory<T,D extends ObjectDefinition<? extends T>>
extends Object

Provides support for converting certain objects to a definition string and vice versa based on the ObjectDefinitionies available for the supported object type and its sub-types.

Author:
Simon Templer

Constructor Summary
AbstractObjectFactory()
          Default constructor.
 
Method Summary
<X extends T>
String
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).
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 CRS definition instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractObjectFactory

public AbstractObjectFactory()
Default constructor.

Method Detail

getDefinitions

protected abstract List<D> getDefinitions()
Get all available definitions compatible with the supported type.

Returns:
the definitions

asString

public <X extends T> String 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).

Type Parameters:
X - the object type, an ObjectDefinition supporting this type must be available
Parameters:
object - the object to create a string representation for
Returns:
the string representation of the object or null if no corresponding ObjectDefinition is available
See Also:
getDefinitions()

parse

public T parse(String value)
Parse the given definition string and create a CRS definition instance.

Parameters:
value - the definition string to parse
Returns:
the CRS definition instance or null

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d