Class AttributeNode

java.lang.Object
com.aquima.interactions.rule.graph.AttributeNode
All Implemented Interfaces:
IAttributeNode

public class AttributeNode extends Object implements IAttributeNode
Node of the rule graph representing a single attribute for the specific entity type. The same attribute from the meta-model may have multiple nodes representing it depending on the inheritance structure of the entity it is defined in.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • AttributeNode

      public AttributeNode(String entityName, String attributeName, AttributeNode parent)
      Constructs the attribute node with the required parameters.
      Parameters:
      entityName - The entity name of the attribute node.
      attributeName - The attribute name of the node.
      parent - The attribute node from the direct parent entity (optional).
  • Method Details

    • getEntityName

      public String getEntityName()
      Description copied from interface: IAttributeNode
      This method will return the name of the entity the attribute node belongs to. The entity name of this node needs not be the same as the entity the attribute was defined in, as a single attribute may be represented by several attribute nodes belonging to different entities.
      Specified by:
      getEntityName in interface IAttributeNode
      Returns:
      the name of the entity the attribute node belongs to.
    • getAttributeName

      public String getAttributeName()
      Description copied from interface: IAttributeNode
      This method will return the name of the attribute the node represents.
      Specified by:
      getAttributeName in interface IAttributeNode
      Returns:
      the name of the attribute the node represents.
    • getFullName

      protected String getFullName()
    • getParentNode

      public IAttributeNode getParentNode()
      Description copied from interface: IAttributeNode
      This method returns the node representing this same attribute in the super type of the current entity. If the entity that contains the attribute this node represents does not have a super-type, then the method will return a null value.
      Specified by:
      getParentNode in interface IAttributeNode
      Returns:
      The attribute node of the attribute in the super-type entity.
    • getBusinessRules

      public IBusinessRule[] getBusinessRules(RuleType type)
      Description copied from interface: IAttributeNode
      This method returns the business rules that are directly coupled to this attribute node. The resulting array is not sorted in any way. The resulting array will never be null, but the array may be empty when no rules are found.
      Specified by:
      getBusinessRules in interface IAttributeNode
      Parameters:
      type - The type of the business rules that are requested.
      Returns:
      IBusinessRule[]
    • addInferenceObject

      protected void addInferenceObject(IBusinessRule obj)
    • addConstraint

      protected void addConstraint(IConstraint constraint)
    • addValidation

      protected void addValidation(IValidationRule validation)
    • addValueSource

      protected void addValueSource(IInferenceRule source)
    • getRuleList

      protected Collection<? extends IBusinessRule> getRuleList(RuleType type)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasSharedParent

      public boolean hasSharedParent(IAttributeNode node)
      Description copied from interface: IAttributeNode
      This method returns a boolean indicating if this node shares a common parent with the specified attribute node.
      Specified by:
      hasSharedParent in interface IAttributeNode
      Parameters:
      node - The attribute node for which the check should be performed.
      Returns:
      a boolean indicating if this node shares a common parent with the specified attribute node.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object