Class ModelFactory
java.lang.Object
de.uni_trier.wi2.procake.data.model.ModelFactory
- All Implemented Interfaces:
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 method
newModel(String)
}.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
bind
(ModelFactoryObject implementation) boolean
Bind an implementation to the factory.static Model
static Model
static String
getModelPath
(String name) static AttributePath
Creates a newAttributePath
that can be used to resolve attributes inAggregateObject
s.static Model
This method creates a new model and may overwrite an existing models with the same name.void
reset()
This method has to be implemented by every factory in order to allow a proper restart of ProCAKE.static boolean
unbind
(ModelFactoryObject implementation) boolean
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 Details
-
DEFAULT_MODEL_NAME
-
-
Method Details
-
bind
-
getDefaultModel
- Returns:
- The system default
Model
.
-
getModel
- Parameters:
name
- model name defined in composition.xml- Returns:
- The model
Model
with the given name.
-
getModelPath
- Parameters:
name
- model name defined in composition.xml- Returns:
- The model path with the given name.
-
newModel
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 newModel
will be the default Model. It is not possible to go back to the previous model.- Returns:
-
newAttributePath
Creates a newAttributePath
that can be used to resolve attributes inAggregateObject
s. For example, viaAggregateObject.resolveAttributeValue(AttributePath)
the value of the defined attribute path is returned.- Returns:
- A new AttributePath object.
-
unbind
-
reset
public void reset()Description copied from interface:Factory
This 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
Description copied from interface:Factory
Bind an implementation to the factory. -
unbind
Description copied from interface:Factory
Unbinds an implementation from the factory.
-