org.caleigo.core
Interface IEntityRelation

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
EntityRelation

public interface IEntityRelation
extends java.io.Serializable

The IEntityRelation interface defines a link between two different entity descriptors. An IEntityRelation does allways consist of one or more IFieldRelation objects. The relation objects does combined with the descriptor objects form a traversable graph.

Version:
1.00
Author:
Dennis Zikovic

Method Summary
 boolean canBeFullReference(IEntityDescriptor entityDescriptor)
          Boolean help method that returns true if the provided IEntityDescriptor can act as a complete reference object according to the relation object.
 boolean canBeReference(IEntityDescriptor entityDescriptor)
          Boolean help method that returns true if the provided IEntityDescriptor can act as a reference object according to the relation object.
 boolean canBeTarget(IEntityDescriptor entityDescriptor)
          Boolean help method that returns true if the provided IEntityDescriptor can be a targeted entity type according to the relation object.
 java.lang.String getCodeName()
          Returns an identifying name that can be used to address the relation in client software.
 int getFieldCount()
          Access method that returns the number of IFieldRelation:s that defines the entity relation.
 IFieldRelation getFieldRelation(int index)
          Access method that returns the indexed contained IFieldRelation.
 java.util.Iterator getFieldRelations()
          Access method that returns an iterator for all contained IFieldRelation objects.
 java.lang.String getForwardDisplayName()
          Returns a displayable name for the relation in the forward direction.
 IEntityDescriptor getReferenceEntityDescriptor()
          Access method that returns the referenced IEntityDescriptor.
 java.util.Iterator getReferenceFieldDescriptors()
          Access method that returns an iterator containing all the IFieldDescriptors from the reference/source descriptor.
 IEntityDescriptor getRelatedEntityDescriptor(IEntityDescriptor entityDescriptor)
          Help method that returns that returns "the other" entity descriptor that link together by the relation object.
 Qualifier getRelationQualifier()
          Returns a Qualifier that specifies the requirements to satisfy all field relations for the entity relation.
 java.lang.String getReverseDisplayName()
          Returns a displayable name for the relation in the reverse direction.
 IEntityDescriptor getTargetEntityDescriptor()
          Access method that returns the tageteted IEntityDescriptor.
 java.util.Iterator getTargetFieldDescriptors()
          Access method that returns an iterator containing all the IFieldDescriptors from the targeted descriptor.
 boolean isRelationField(IFieldDescriptor fieldDescriptor)
          Help method that returns true if the provided field descriptor exists as a part of one of the entity relations contained field relations.
 boolean isRelationNode(IEntityDescriptor entityDescriptor)
          Help method that returns true if the provided entity descriptor is one of the fysical node descriptors of the relation objects.
 boolean isRequired()
          Returns true if the relation is required.
 

Method Detail

getFieldCount

public int getFieldCount()
Access method that returns the number of IFieldRelation:s that defines the entity relation.


getFieldRelation

public IFieldRelation getFieldRelation(int index)
Access method that returns the indexed contained IFieldRelation.


getFieldRelations

public java.util.Iterator getFieldRelations()
Access method that returns an iterator for all contained IFieldRelation objects.


getReferenceEntityDescriptor

public IEntityDescriptor getReferenceEntityDescriptor()
Access method that returns the referenced IEntityDescriptor.


getReferenceFieldDescriptors

public java.util.Iterator getReferenceFieldDescriptors()
Access method that returns an iterator containing all the IFieldDescriptors from the reference/source descriptor.


getTargetEntityDescriptor

public IEntityDescriptor getTargetEntityDescriptor()
Access method that returns the tageteted IEntityDescriptor.


getTargetFieldDescriptors

public java.util.Iterator getTargetFieldDescriptors()
Access method that returns an iterator containing all the IFieldDescriptors from the targeted descriptor.


getCodeName

public java.lang.String getCodeName()
Returns an identifying name that can be used to address the relation in client software.


getForwardDisplayName

public java.lang.String getForwardDisplayName()
Returns a displayable name for the relation in the forward direction.


getReverseDisplayName

public java.lang.String getReverseDisplayName()
Returns a displayable name for the relation in the reverse direction.


isRelationNode

public boolean isRelationNode(IEntityDescriptor entityDescriptor)
Help method that returns true if the provided entity descriptor is one of the fysical node descriptors of the relation objects. Custom entities that contains the fields that are a part of the relation will not qualify by this method.


isRelationField

public boolean isRelationField(IFieldDescriptor fieldDescriptor)
Help method that returns true if the provided field descriptor exists as a part of one of the entity relations contained field relations.


isRequired

public boolean isRequired()
Returns true if the relation is required. Required relation does allways for each entity instance of the reference node side in the relation.


canBeReference

public boolean canBeReference(IEntityDescriptor entityDescriptor)
Boolean help method that returns true if the provided IEntityDescriptor can act as a reference object according to the relation object. Either fully or partially that is if the descriptor can adreess one ore more of the targetet entity type.


canBeFullReference

public boolean canBeFullReference(IEntityDescriptor entityDescriptor)
Boolean help method that returns true if the provided IEntityDescriptor can act as a complete reference object according to the relation object. Complete/full reference means that all the reference field descriptors are satisfied and that a single entity instance of the targeted entity type can be addressed.


canBeTarget

public boolean canBeTarget(IEntityDescriptor entityDescriptor)
Boolean help method that returns true if the provided IEntityDescriptor can be a targeted entity type according to the relation object.


getRelatedEntityDescriptor

public IEntityDescriptor getRelatedEntityDescriptor(IEntityDescriptor entityDescriptor)
Help method that returns that returns "the other" entity descriptor that link together by the relation object. If the provided descriptor is not a node in the realtion then null is returned.


getRelationQualifier

public Qualifier getRelationQualifier()
Returns a Qualifier that specifies the requirements to satisfy all field relations for the entity relation.



Copyright © 2005 Caleigo. All Rights Reserved.