Class AttributeDefinition

java.lang.Object
com.aquima.interactions.metamodel.impl.AttributeDefinition
All Implemented Interfaces:
IAttributeDefinition, Serializable

public class AttributeDefinition extends Object implements IAttributeDefinition
This class holds the static definition of an attribute in the meta model.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • AttributeDefinition

      public AttributeDefinition(IMetaModel metamodel, String entityName, IAttributeDS datasource)
      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

      protected AttributeDefinition(IAttributeDefinition other)
  • Method Details

    • getId

      public String 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 interface IAttributeDefinition
      Returns:
      the unique identifier of the attribute.
    • getName

      public String 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 interface IAttributeDefinition
      Returns:
      String containing the name of the attribute.
    • getEntityName

      public String getEntityName()
      Description copied from interface: IAttributeDefinition
      This method returns the name of the entity that contains this attribute.
      Specified by:
      getEntityName in interface IAttributeDefinition
      Returns:
      String containing the name of the entity that defines the attribute.
    • getFullName

      public String 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 interface IAttributeDefinition
      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 interface IAttributeDefinition
      Returns:
      boolean indicating whether the attribute may contain multiple values.
    • getDataType

      public DataType getDataType()
      Description copied from interface: IAttributeDefinition
      This method returns the data type of the attribute.
      Specified by:
      getDataType in interface IAttributeDefinition
      Returns:
      DataType object indicating the type of the values for this attribute.
    • getRelation

      public IRelationDefinition 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 interface IAttributeDefinition
      Returns:
      IRelationDefinition containing information about the entity relation.
    • setRelatedAttribute

      protected void setRelatedAttribute(String attribute)
    • getDomain

      public IDomainDefinition 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 interface IAttributeDefinition
      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 interface IAttributeDefinition
      Returns:
      boolean indicating whether the attribute can be answered by a client.
    • getFunctionalName

      public String getFunctionalName()
      Description copied from interface: IAttributeDefinition
      This method return the functional name of the attribute.
      Specified by:
      getFunctionalName in interface IAttributeDefinition
      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 interface IAttributeDefinition
      Returns:
      A boolean indicating that this attribute acts as a reference
    • getReferenceDefinition

      public IReferenceDefinition getReferenceDefinition()
      Description copied from interface: IAttributeDefinition
      Returns the reference definition of the attribute or null if this attribute is not a reference. Method IAttributeDefinition.isReference() should be used to check whether this attribute is a reference.
      Specified by:
      getReferenceDefinition in interface IAttributeDefinition
      Returns:
      The reference definition of the attribute
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object