Interface IEntityDefinition

All Superinterfaces:
Serializable
All Known Implementing Classes:
EntityDefinition

public interface IEntityDefinition extends Serializable
This interface defines several methods that can be used to retrieve static information about an entity.
Since:
5.0
Author:
O. Kerpershoek, F. v.d. Meer
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsAttribute(String attributeName, boolean includeSuperTypes)
    This method checks if the entity definition contains an attribute with the specified name.
    getAttribute(String attributeName)
    This method returns the attribute definition for the given attribute name.
    int
    getAttributeCount(boolean includeSuperTypes)
    This method returns the number of attributes that are defined in this entity.
    getAttributes(boolean includeSuperTypes)
    This method returns an array containing the attribute definitions belonging to this entity definition.
    This method returns the unique identifier of the entity, consisting of the lowercased entity name.
    This method returns a unique identifier for this type of entity.
    This method return the default name of the singleton instance.
    This method will return an array of entity definitions of those entity types that are a direct descendant from this type.
    This method return the definition of the direct super type of this definition.
    boolean
    This method returns a boolean indicating if the entity definition is abstract, and may only used as super type of other entity definitions.
    boolean
    This method returns whether this type of entity may only exists once at runtime.
    boolean
    typeOf(String name)
    This method determines whether this instance is of the supplied type.
  • Method Details

    • getId

      String getId()
      This method returns the unique identifier of the entity, consisting of the lowercased entity name.
      Returns:
      the unique identifier of the entity.
    • getName

      String getName()
      This method returns a unique identifier for this type of entity.
      Returns:
      String containing a unique identifier for this type of entity.
    • typeOf

      boolean typeOf(String name)
      This method determines whether this instance is of the supplied type. The definition is considered of the same type when either the supplied type is exactly the same as the type of this definition, or when the supplied type matches the type of a parent definition.
      Parameters:
      name - String with the name of the entity type.
      Returns:
      true when this definition is of the specified type, false otherwise
    • isSingleton

      boolean isSingleton()
      This method returns whether this type of entity may only exists once at runtime. A singleton instance will always get an id with value 0 (zero) and can be requested by using the getSingletonInstance method from the profile.
      Returns:
      boolean indicating if the entity type is defined as singleton.
    • isAbstract

      boolean isAbstract()
      This method returns a boolean indicating if the entity definition is abstract, and may only used as super type of other entity definitions. Abstract entities can never be instantiated in the profile. If an entity is defined both abstract and singleton, the profile may hold multiple instances of this type, but each instance of an entity extending this abstract type must be a singleton.
      Returns:
      A boolean indicating if the entity definition is abstract.
    • getSingletonName

      String getSingletonName()
      This method return the default name of the singleton instance. The singleton name is only applicable when the entity is defined as singleton.
      Returns:
      The name of the singleton of this entity.
    • getSuperType

      IEntityDefinition getSuperType()
      This method return the definition of the direct super type of this definition. When this definition is a top level entity which is not derived from a base type, this method will return a null value.
      Returns:
      Entity definition of the direct super type, or null when this is a top level entity.
    • getSubTypes

      IEntityDefinition[] getSubTypes()
      This method will return an array of entity definitions of those entity types that are a direct descendant from this type. When there are no entity sub-types derived from this type, an empty array will be returned.
      Returns:
      Array containing the definition of the direct descendants of this entity type.
    • getAttributeCount

      int getAttributeCount(boolean includeSuperTypes)
      This method returns the number of attributes that are defined in this entity. Depending on the value of the includeSuperTypes parameter, this method will also count the number of attributes that are defined in the super types of this definition. When the includeSuperTypes has a value false this method will only return the number of attributes that are directly defined in this entity definition.
      Parameters:
      includeSuperTypes - Boolean indicating whether the super type(s) of this definition should also be counted.
      Returns:
      The number of attributes that are present in the definition.
    • containsAttribute

      boolean containsAttribute(String attributeName, boolean includeSuperTypes)
      This method checks if the entity definition contains an attribute with the specified name. The attribute name is not case sensitive, and should not contain the entity name (no dotted notation allowed here). Depending on the value of includeSuperTypes this method will also check if the attribute is defined in a super type of this definition.
      Parameters:
      attributeName - The name of the attribute.
      includeSuperTypes - Boolean indicating whether the super type(s) of this definition should also be checked.
      Returns:
      true if the entity definition contains the attribute, false otherwise.
    • getAttributes

      IAttributeDefinition[] getAttributes(boolean includeSuperTypes)
      This method returns an array containing the attribute definitions belonging to this entity definition. If the entity definition does not contain any attributes, an empty array will be returned. Depending on the value of the includeSuperTypes parameter, also the attribute definitions of the super types will be returned.
      Parameters:
      includeSuperTypes - Boolean indicating whether the super type(s) of this definition should also be processed.
      Returns:
      Array containing the attribute definition of this entity.
    • getAttribute

      IAttributeDefinition getAttribute(String attributeName)
      This method returns the attribute definition for the given attribute name. The attribute name is not case sensitive, and should not contain the entity name (no dotted notation allowed here).
      Parameters:
      attributeName - The name of the attribute for which the definition should be returned.
      Returns:
      The attribute definition for supplied attribute name.
      Throws:
      UnknownAttributeException - An unknown attribute exception is raised when the supplied name does not belong to an attribute of this entity definition.