Class AttributeDefinition
java.lang.Object
com.aquima.interactions.metamodel.impl.AttributeDefinition
- All Implemented Interfaces:
IAttributeDefinition
,Serializable
This class holds the static definition of an attribute in the meta model.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AttributeDefinition
(IMetaModel metamodel, String entityName, IAttributeDS datasource) Constructs an attribute definition from a data source. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method returns the data type of the attribute.This method returns the domain definition of the attribute.This method returns the name of the entity that contains this attribute.This method return the full name of the attribute.This method return the functional name of the attribute.getId()
This method returns the unique identifier of the attribute, consisting of the entity in which the attribute is defined plus the attribute name, lowercased, e.g.getName()
This method returns the name of the attribute.Returns the reference definition of the attribute or null if this attribute is not a reference.This method returns an object containing information about the relation.int
hashCode()
boolean
This method indicates whether the attribute can be answered by a client.boolean
This method indicates whether the attribute may contain multiple values.boolean
Indicates that this attribute acts as a reference.protected void
setRelatedAttribute
(String attribute) toString()
-
Constructor Details
-
AttributeDefinition
public AttributeDefinition(IMetaModel metamodel, String entityName, IAttributeDS datasource) throws InitializationException Constructs an attribute definition from a data source. This method requires the (partially) initialized meta model to lookup definitions of objects that are used by this attribute.- Parameters:
metamodel
- The meta model the attribute will be part of.entityName
- The entity name the attribute will be part of.datasource
- The data source providing the information of the attribute.- Throws:
InitializationException
- This error is thrown when structural errors are encountered during initialization.
-
AttributeDefinition
-
-
Method Details
-
getId
Description copied from interface:IAttributeDefinition
This method returns the unique identifier of the attribute, consisting of the entity in which the attribute is defined plus the attribute name, lowercased, e.g. entity.attribute- Specified by:
getId
in interfaceIAttributeDefinition
- Returns:
- the unique identifier of the attribute.
-
getName
Description copied from interface:IAttributeDefinition
This method returns the name of the attribute. The name of an attribute is unique within the entity where it is defined. For entities that have a super-type, the name will be unique within the complete entity structure. It is however possible that two entities that are not related contain an attribute with the same name.- Specified by:
getName
in interfaceIAttributeDefinition
- Returns:
- String containing the name of the attribute.
-
getEntityName
Description copied from interface:IAttributeDefinition
This method returns the name of the entity that contains this attribute.- Specified by:
getEntityName
in interfaceIAttributeDefinition
- Returns:
- String containing the name of the entity that defines the attribute.
-
getFullName
Description copied from interface:IAttributeDefinition
This method return the full name of the attribute. The full name consists of both the entity name and the attribute name separated with a dot.- Specified by:
getFullName
in interfaceIAttributeDefinition
- Returns:
- String with the full attribute name.
-
isMultiValue
public boolean isMultiValue()Description copied from interface:IAttributeDefinition
This method indicates whether the attribute may contain multiple values.- Specified by:
isMultiValue
in interfaceIAttributeDefinition
- Returns:
- boolean indicating whether the attribute may contain multiple values.
-
getDataType
Description copied from interface:IAttributeDefinition
This method returns the data type of the attribute.- Specified by:
getDataType
in interfaceIAttributeDefinition
- Returns:
- DataType object indicating the type of the values for this attribute.
-
getRelation
Description copied from interface:IAttributeDefinition
This method returns an object containing information about the relation. The relation definition is only relevant for attributes of type Entity, as only those attributes can define a relation to another entity. For attributes that are not of the DataType Entity, this method will return a null value.- Specified by:
getRelation
in interfaceIAttributeDefinition
- Returns:
- IRelationDefinition containing information about the entity relation.
-
setRelatedAttribute
-
getDomain
Description copied from interface:IAttributeDefinition
This method returns the domain definition of the attribute. The value null will be returned for attributes that are not bound to any constraints. The returned domain is the static definition of the domain containing all possible values.- Specified by:
getDomain
in interfaceIAttributeDefinition
- Returns:
- Domain definition of the attribute, or null if not applicable.
-
isAskable
public boolean isAskable()Description copied from interface:IAttributeDefinition
This method indicates whether the attribute can be answered by a client.- Specified by:
isAskable
in interfaceIAttributeDefinition
- Returns:
- boolean indicating whether the attribute can be answered by a client.
-
getFunctionalName
Description copied from interface:IAttributeDefinition
This method return the functional name of the attribute.- Specified by:
getFunctionalName
in interfaceIAttributeDefinition
- Returns:
- String with the functional attribute name.
-
isReference
public boolean isReference()Description copied from interface:IAttributeDefinition
Indicates that this attribute acts as a reference. If this method returns true,IAttributeDefinition.getReferenceDefinition()
will return a non-null value.- Specified by:
isReference
in interfaceIAttributeDefinition
- Returns:
- A boolean indicating that this attribute acts as a reference
-
getReferenceDefinition
Description copied from interface:IAttributeDefinition
Returns the reference definition of the attribute or null if this attribute is not a reference. MethodIAttributeDefinition.isReference()
should be used to check whether this attribute is a reference.- Specified by:
getReferenceDefinition
in interfaceIAttributeDefinition
- Returns:
- The reference definition of the attribute
-
equals
-
hashCode
public int hashCode() -
toString
-