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 method newModel(String)}.

Author:
Rainer Maximini, Christian Zeyen
See Also:
  • Field Details

    • DEFAULT_MODEL_NAME

      public static String DEFAULT_MODEL_NAME
  • Method Details

    • bind

      public static boolean bind(ModelFactoryObject implementation)
    • getDefaultModel

      public static Model getDefaultModel()
      Returns:
      The system default Model.
    • getModel

      public static Model getModel(String name)
      Parameters:
      name - model name defined in composition.xml
      Returns:
      The model Model with 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 equals DEFAULT_MODEL_NAME, the new Model will be the default Model. It is not possible to go back to the previous model.
      Returns:
    • newAttributePath

      public static AttributePath newAttributePath()
      Creates a new AttributePaththat can be used to resolve attributes in AggregateObjects. For example, via AggregateObject.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: 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.
      Specified by:
      reset in interface Factory
    • bind

      public boolean bind(Object implementation)
      Description copied from interface: Factory
      Bind an implementation to the factory.
      Specified by:
      bind in interface Factory
      Parameters:
      implementation -
      Returns:
      Returns true if the bind was successful
      See Also:
    • unbind

      public boolean unbind(Object implementation)
      Description copied from interface: Factory
      Unbinds an implementation from the factory.
      Specified by:
      unbind in interface Factory
      Parameters:
      implementation -
      Returns:
      Returns true if the unbind was successful
      See Also: