org.deduced
Class DefaultModelFactory

java.lang.Object
  extended by org.deduced.DefaultModelFactory
All Implemented Interfaces:
ModelFactory, TypeBasedModelFactory

public class DefaultModelFactory
extends java.lang.Object
implements TypeBasedModelFactory

Default Model Factory

Author:
Steve McDuff

Field Summary
private  java.util.Map<PropertyCollection<?,?>,java.lang.Class<?>> modelCreationMap
          map between the type of collection to create and the class used to create them.
 
Constructor Summary
DefaultModelFactory()
           
 
Method Summary
 void addModelType(java.lang.Class<?> modelClass, PropertyCollection<?,?> modelType)
          (non-Javadoc)
 PropertyCollection<?,?> createModel(PropertyCollection<?,?> type)
          (non-Javadoc)
 PropertyCollection<?,?> createModel(PropertyCollection<?,?> type, boolean activated)
          (non-Javadoc)
 java.lang.Class<?> getClassFromType(PropertyCollection<?,?> type)
          (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelCreationMap

private java.util.Map<PropertyCollection<?,?>,java.lang.Class<?>> modelCreationMap
map between the type of collection to create and the class used to create them.

Constructor Detail

DefaultModelFactory

public DefaultModelFactory()
Method Detail

createModel

public PropertyCollection<?,?> createModel(PropertyCollection<?,?> type,
                                           boolean activated)
(non-Javadoc)

Specified by:
createModel in interface ModelFactory
Parameters:
type - type of collection to create
activated - is activated or not
Returns:
the created collection.
See Also:
ModelFactory.createModel(org.deduced.PropertyCollection, boolean)

createModel

public PropertyCollection<?,?> createModel(PropertyCollection<?,?> type)
(non-Javadoc)

Specified by:
createModel in interface ModelFactory
Parameters:
type - the type of model to create
Returns:
the created model
See Also:
ModelFactory.createModel(org.deduced.PropertyCollection)

addModelType

public void addModelType(java.lang.Class<?> modelClass,
                         PropertyCollection<?,?> modelType)
(non-Javadoc)

Specified by:
addModelType in interface TypeBasedModelFactory
Parameters:
modelClass - the model class
modelType - the model type to associate with the class
See Also:
TypeBasedModelFactory.addModelType(java.lang.Class, org.deduced.PropertyCollection)

getClassFromType

public java.lang.Class<?> getClassFromType(PropertyCollection<?,?> type)
(non-Javadoc)

Specified by:
getClassFromType in interface TypeBasedModelFactory
Parameters:
type - the collection type
Returns:
the associated class
See Also:
TypeBasedModelFactory.getClassFromType(org.deduced.PropertyCollection)