Class MetaModel

java.lang.Object
com.aquima.interactions.metamodel.impl.MetaModel
All Implemented Interfaces:
IMetaModel, Serializable

public class MetaModel extends Object implements IMetaModel
This class holds all the static definitions of the meta model.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • MetaModel

      public MetaModel(IMetaModelDS datasource)
      Constructs a meta model from the data provided by the data source (with no external domain definitions).
      Parameters:
      datasource - The data source providing the information for the meta model.
      Throws:
      InitializationException - This error is thrown when structural errors are encountered during initialization.
    • MetaModel

      public MetaModel(IMetaModelDS datasource, IDomainValuesFactory domainFactory)
      Constructs a meta model from the data provided by the data source.
      Parameters:
      datasource - The data source providing the information for the meta model.
      domainFactory - The factory providing domain definitions for external domains.
      Throws:
      InitializationException - This error is thrown when structural errors are encountered during initialization.
  • Method Details

    • validateEntityRelations

      protected void validateEntityRelations(IReportingDS report, IEntityDefinition entity)
    • validateInstance

      protected void validateInstance(IInstanceDefinition definition)
    • validateReferences

      protected void validateReferences(IInstanceDefinition instance, IInstanceReference[] references)
    • addDomain

      protected void addDomain(IDomainDefinition definition)
    • getModuleName

      public String getModuleName()
      Description copied from interface: IMetaModel
      This method returns the name of the module this model belongs to.
      Specified by:
      getModuleName in interface IMetaModel
      Returns:
      the name of the module this model belongs to.
    • getModuleVersion

      public Version getModuleVersion()
      Description copied from interface: IMetaModel
      This method returns the version of the module this model belongs to.
      Specified by:
      getModuleVersion in interface IMetaModel
      Returns:
      The version of the module this model belongs to.
    • containsDomain

      public boolean containsDomain(String domainName)
      Description copied from interface: IMetaModel
      This method returns a boolean indicating whether a definition is present for a domain with the supplied name. The name is not case sensitive.
      Specified by:
      containsDomain in interface IMetaModel
      Parameters:
      domainName - The name of the domain for which the presence is queried
      Returns:
      (boolean) true when the domain is present, false otherwise.
    • getDomainDefinition

      public IDomainDefinition getDomainDefinition(String domainName)
      Description copied from interface: IMetaModel
      This method returns the domain definition for the supplied domain name. The domain name is not case sensitive.
      Specified by:
      getDomainDefinition in interface IMetaModel
      Parameters:
      domainName - The name of the domain for which the definition is requested.
      Returns:
      Definition of the domain with requested name
    • addEntity

      protected void addEntity(IEntityDS datasource)
    • containsEntity

      public boolean containsEntity(String entityName)
      Description copied from interface: IMetaModel
      This method returns a boolean indicating whether a definition is present for an entity with the supplied name. The name is not case sensitive.
      Specified by:
      containsEntity in interface IMetaModel
      Parameters:
      entityName - The name of the entity for which the presence is queried
      Returns:
      (boolean) true when the entity is present, false otherwise.
    • getEntityDefinition

      public IEntityDefinition getEntityDefinition(String entityName)
      Description copied from interface: IMetaModel
      This method returns the entity definition for the supplied entity name. The entity name is not case sensitive.
      Specified by:
      getEntityDefinition in interface IMetaModel
      Parameters:
      entityName - The name of the entity for which the definition is requested.
      Returns:
      Definition of the entity with requested name
    • getDomainDefinitions

      public IDomainDefinition[] getDomainDefinitions()
      Description copied from interface: IMetaModel
      This method returns an array containing all the domain definitions that are present in the metamodel.
      Specified by:
      getDomainDefinitions in interface IMetaModel
      Returns:
      Array of all the domain definitions (never null).
    • getEntityDefinitions

      public IEntityDefinition[] getEntityDefinitions(boolean includeSubTypes)
      Description copied from interface: IMetaModel
      This method returns an array containing all the entity definitions that are present in the metamodel. Please note that entities may be related to each other, and that this array will contain both the parent and the child definition if such a relation exists.
      Specified by:
      getEntityDefinitions in interface IMetaModel
      Parameters:
      includeSubTypes - States wether all entity definitions will be returned, or in case of false only the root entities which have no children.
      Returns:
      Array of all the entity definitions (never null).
    • addAggregate

      protected void addAggregate(IAggregateDS datasource)
    • containsAggregate

      public boolean containsAggregate(String aggregateName)
      Description copied from interface: IMetaModel
      This method returns a boolean indicating whether a definition is present for an aggregate with the supplied name.
      Specified by:
      containsAggregate in interface IMetaModel
      Parameters:
      aggregateName - The name of the aggregate for which the presence is queried.
      Returns:
      (boolean) true when the aggregate is present, false otherwise.
    • getAggregateDefinitions

      public IAggregateDefinition[] getAggregateDefinitions()
      Description copied from interface: IMetaModel
      This method returns an array containing all the aggregate definitions that are present in the meta model.
      Specified by:
      getAggregateDefinitions in interface IMetaModel
      Returns:
      Array of all the aggregate definitions (never null).
    • getAggregateDefinition

      public IAggregateDefinition getAggregateDefinition(String aggregateName)
      Description copied from interface: IMetaModel
      This method returns the aggregate definition for the supplied aggregate name.
      Specified by:
      getAggregateDefinition in interface IMetaModel
      Parameters:
      aggregateName - The name of the aggregate for which the definition is requested.
      Returns:
      Definition of the aggregate with requested name
    • containsInstanceDefinition

      public boolean containsInstanceDefinition(String entityName, String instanceName)
      Description copied from interface: IMetaModel
      This method will return if an instance definition is present with the given name for the entity type specified. This method will not check any super-type, and only return true when the definition is present for the exact entity type as specified.
      Specified by:
      containsInstanceDefinition in interface IMetaModel
      Parameters:
      entityName - The entity name for which the existence of an instance definition should be checked.
      instanceName - The name of the instance definition.
      Returns:
      true when the entity type contains an instance definition for the specified name, false otherwise.
    • getAllInstanceDefinitions

      public IInstanceDefinition[] getAllInstanceDefinitions()
      Description copied from interface: IMetaModel
      This method will return an array containing all the instance definitions that are present. When no instance definitions are found, an empty array will be returned.
      Specified by:
      getAllInstanceDefinitions in interface IMetaModel
      Returns:
      Array containing all instance definitions.
    • getInstanceDefinition

      public IInstanceDefinition getInstanceDefinition(String entityName, String instanceName)
      Description copied from interface: IMetaModel
      This method will return the instance definition for the specified name and type.
      Specified by:
      getInstanceDefinition in interface IMetaModel
      Parameters:
      entityName - The entity name of which the instance definition is requested.
      instanceName - The name of definition that is requested.
      Returns:
      Instance definition for the specified name and type.
    • addInstanceDefinition

      protected void addInstanceDefinition(IInstanceDefinition definition)
    • getDomainValuesFactory

      protected IDomainValuesFactory getDomainValuesFactory()
    • toString

      public String toString()
      Overrides:
      toString in class Object