Class MetaModel
java.lang.Object
com.aquima.interactions.metamodel.impl.MetaModel
- All Implemented Interfaces:
IMetaModel
,Serializable
This class holds all the static definitions of the meta model.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaModel
(IMetaModelDS datasource) Constructs a meta model from the data provided by the data source (with no external domain definitions).MetaModel
(IMetaModelDS datasource, IDomainValuesFactory domainFactory) Constructs a meta model from the data provided by the data source. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAggregate
(IAggregateDS datasource) protected void
addDomain
(IDomainDefinition definition) protected void
protected void
addInstanceDefinition
(IInstanceDefinition definition) boolean
containsAggregate
(String aggregateName) This method returns a boolean indicating whether a definition is present for an aggregate with the supplied name.boolean
containsDomain
(String domainName) This method returns a boolean indicating whether a definition is present for a domain with the supplied name.boolean
containsEntity
(String entityName) This method returns a boolean indicating whether a definition is present for an entity with the supplied name.boolean
containsInstanceDefinition
(String entityName, String instanceName) This method will return if an instance definition is present with the given name for the entity type specified.getAggregateDefinition
(String aggregateName) This method returns the aggregate definition for the supplied aggregate name.This method returns an array containing all the aggregate definitions that are present in the meta model.This method will return an array containing all the instance definitions that are present.getDomainDefinition
(String domainName) This method returns the domain definition for the supplied domain name.This method returns an array containing all the domain definitions that are present in the metamodel.protected IDomainValuesFactory
getEntityDefinition
(String entityName) This method returns the entity definition for the supplied entity name.getEntityDefinitions
(boolean includeSubTypes) This method returns an array containing all the entity definitions that are present in the metamodel.getInstanceDefinition
(String entityName, String instanceName) This method will return the instance definition for the specified name and type.This method returns the name of the module this model belongs to.This method returns the version of the module this model belongs to.toString()
protected void
validateEntityRelations
(IReportingDS report, IEntityDefinition entity) protected void
validateInstance
(IInstanceDefinition definition) protected void
validateReferences
(IInstanceDefinition instance, IInstanceReference[] references)
-
Constructor Details
-
MetaModel
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) throws InitializationException 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) throws InitializationException - Throws:
InitializationException
-
validateInstance
- Throws:
InitializationException
-
validateReferences
protected void validateReferences(IInstanceDefinition instance, IInstanceReference[] references) throws InitializationException - Throws:
InitializationException
-
addDomain
- Throws:
InitializationException
-
getModuleName
Description copied from interface:IMetaModel
This method returns the name of the module this model belongs to.- Specified by:
getModuleName
in interfaceIMetaModel
- Returns:
- the name of the module this model belongs to.
-
getModuleVersion
Description copied from interface:IMetaModel
This method returns the version of the module this model belongs to.- Specified by:
getModuleVersion
in interfaceIMetaModel
- Returns:
- The version of the module this model belongs to.
-
containsDomain
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 interfaceIMetaModel
- Parameters:
domainName
- The name of the domain for which the presence is queried- Returns:
- (boolean) true when the domain is present, false otherwise.
-
getDomainDefinition
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 interfaceIMetaModel
- Parameters:
domainName
- The name of the domain for which the definition is requested.- Returns:
- Definition of the domain with requested name
- Throws:
UnknownDomainException
- An unknown domain exception is thrown when the supplied name does not match any domain known to the metamodel.
-
addEntity
- Throws:
InitializationException
-
containsEntity
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 interfaceIMetaModel
- Parameters:
entityName
- The name of the entity for which the presence is queried- Returns:
- (boolean) true when the entity is present, false otherwise.
-
getEntityDefinition
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 interfaceIMetaModel
- Parameters:
entityName
- The name of the entity for which the definition is requested.- Returns:
- Definition of the entity with requested name
- Throws:
UnknownEntityException
- An unknown entity exception is thrown when the supplied name does not match any entity known to the metamodel.
-
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 interfaceIMetaModel
- Returns:
- Array of all the domain definitions (never null).
-
getEntityDefinitions
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 interfaceIMetaModel
- 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
- Throws:
InitializationException
-
containsAggregate
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 interfaceIMetaModel
- Parameters:
aggregateName
- The name of the aggregate for which the presence is queried.- Returns:
- (boolean) true when the aggregate is present, false otherwise.
-
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 interfaceIMetaModel
- Returns:
- Array of all the aggregate definitions (never null).
-
getAggregateDefinition
public IAggregateDefinition getAggregateDefinition(String aggregateName) throws UnknownAggregateException Description copied from interface:IMetaModel
This method returns the aggregate definition for the supplied aggregate name.- Specified by:
getAggregateDefinition
in interfaceIMetaModel
- Parameters:
aggregateName
- The name of the aggregate for which the definition is requested.- Returns:
- Definition of the aggregate with requested name
- Throws:
UnknownAggregateException
- An unknown aggregate exception is thrown when the supplied name does not match any aggregate known to the meta model.
-
containsInstanceDefinition
public boolean containsInstanceDefinition(String entityName, String instanceName) throws UnknownEntityException 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 interfaceIMetaModel
- 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.
- Throws:
UnknownEntityException
- This exception is raised when the entity name is not recognized as a valid type.
-
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 interfaceIMetaModel
- Returns:
- Array containing all instance definitions.
-
getInstanceDefinition
public IInstanceDefinition getInstanceDefinition(String entityName, String instanceName) throws UnknownEntityException, UnknownInstanceDefinitionException Description copied from interface:IMetaModel
This method will return the instance definition for the specified name and type.- Specified by:
getInstanceDefinition
in interfaceIMetaModel
- 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.
- Throws:
UnknownEntityException
- This exception is raised when the entity name is not recognized as a valid type.UnknownInstanceDefinitionException
- This exception is raised when no definition could be found for the specified name.
-
addInstanceDefinition
- Throws:
InitializationException
-
getDomainValuesFactory
-
toString
-