Class ModelFactory
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.model.ModelFactory
-
- All Implemented Interfaces:
Factory
public class ModelFactory extends Object implements Factory
This is the factory class to access the implementations to the data model interfaces.The system contains one default model that can be accessed via
getDefaultModel(). It can also manage several other models that can be created by the methodnewModel(String)}.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_MODEL_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanbind(ModelFactoryObject implementation)booleanbind(Object implementation)Bind an implementation to the factory.static ModelgetDefaultModel()static ModelgetModel(String name)static StringgetModelPath(String name)static AttributePathnewAttributePath()Creates a newAttributePaththat can be used to resolve attributes inAggregateObjects.static ModelnewModel(String name)This method creates a new model and may overwrite an existing models with the same name.voidreset()This method has to be implemented by every factory in order to allow a proper restart of ProCAKE.static booleanunbind(ModelFactoryObject implementation)booleanunbind(Object implementation)Unbinds an implementation from the factory.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.utils.composition.Factory
addParameter, postInit
-
-
-
-
Field Detail
-
DEFAULT_MODEL_NAME
public static String DEFAULT_MODEL_NAME
-
-
Method Detail
-
bind
public static boolean bind(ModelFactoryObject implementation)
-
getModel
public static Model getModel(String name)
- Parameters:
name- model name defined in composition.xml- Returns:
- The model
Modelwith the given name.
-
getModelPath
public static String getModelPath(String name)
- Parameters:
name- model name defined in composition.xml- Returns:
- The model path with the given name.
-
newModel
public static Model newModel(String name)
This method creates a new model and may overwrite an existing models with the same name.- Parameters:
name- The name of the new model. If name equalsDEFAULT_MODEL_NAME, the newModelwill be the default Model. It is not possible to go back to the previous model.- Returns:
-
newAttributePath
public static AttributePath newAttributePath()
Creates a newAttributePaththat can be used to resolve attributes inAggregateObjects. For example, viaAggregateObject.resolveAttributeValue(AttributePath)the value of the defined attribute path is returned.- Returns:
- A new AttributePath object.
-
unbind
public static boolean unbind(ModelFactoryObject implementation)
-
reset
public void reset()
Description copied from interface:FactoryThis method has to be implemented by every factory in order to allow a proper restart of ProCAKE. For example, this method might reset the default factory object or other stateful variables.
-
bind
public boolean bind(Object implementation)
Description copied from interface:FactoryBind an implementation to the factory.- Specified by:
bindin interfaceFactory- Parameters:
implementation-- Returns:
- Returns
trueif the bind was successful - See Also:
Factory.bind(java.lang.Object)
-
unbind
public boolean unbind(Object implementation)
Description copied from interface:FactoryUnbinds an implementation from the factory.- Specified by:
unbindin interfaceFactory- Parameters:
implementation-- Returns:
- Returns
trueif the unbind was successful - See Also:
Factory.unbind(java.lang.Object)
-
-