org.caleigo.core
Class EntityRelation

java.lang.Object
  extended byorg.caleigo.core.EntityRelation
All Implemented Interfaces:
IEntityRelation, java.io.Serializable

public class EntityRelation
extends java.lang.Object
implements IEntityRelation

Version:
1.00
Author:
Dennis Zikovic
See Also:
Serialized Form

Constructor Summary
(package private) EntityRelation(IFieldRelation[] fieldRelation, java.lang.String codeName, java.lang.String forwardName, java.lang.String reverseName)
          Creates new EntityRelation.
(package private) EntityRelation(IFieldRelation fieldRelation, java.lang.String codeName, java.lang.String forwardName, java.lang.String reverseName)
          Creates new EntityRelation.
 
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.
 boolean equals(java.lang.Object obj)
           
 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.
 int hashCode()
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityRelation

EntityRelation(IFieldRelation fieldRelation,
               java.lang.String codeName,
               java.lang.String forwardName,
               java.lang.String reverseName)
Creates new EntityRelation. Package scope to avoid missuse.


EntityRelation

EntityRelation(IFieldRelation[] fieldRelation,
               java.lang.String codeName,
               java.lang.String forwardName,
               java.lang.String reverseName)
Creates new EntityRelation. Package scope to avoid missuse.

Method Detail

toString

public java.lang.String toString()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

getReferenceEntityDescriptor

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

Specified by:
getReferenceEntityDescriptor in interface IEntityRelation

getReferenceFieldDescriptors

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

Specified by:
getReferenceFieldDescriptors in interface IEntityRelation

getTargetEntityDescriptor

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

Specified by:
getTargetEntityDescriptor in interface IEntityRelation

getTargetFieldDescriptors

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

Specified by:
getTargetFieldDescriptors in interface IEntityRelation

getFieldCount

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

Specified by:
getFieldCount in interface IEntityRelation

getFieldRelations

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

Specified by:
getFieldRelations in interface IEntityRelation

getFieldRelation

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

Specified by:
getFieldRelation in interface IEntityRelation

getCodeName

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

Specified by:
getCodeName in interface IEntityRelation

getForwardDisplayName

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

Specified by:
getForwardDisplayName in interface IEntityRelation

getReverseDisplayName

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

Specified by:
getReverseDisplayName in interface IEntityRelation

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.

Specified by:
isRelationNode in interface IEntityRelation

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.

Specified by:
isRelationField in interface IEntityRelation

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.

Specified by:
isRequired in interface IEntityRelation

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.

Specified by:
canBeReference in interface IEntityRelation

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.

Specified by:
canBeFullReference in interface IEntityRelation

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.

Specified by:
canBeTarget in interface IEntityRelation

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.

Specified by:
getRelatedEntityDescriptor in interface IEntityRelation

getRelationQualifier

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

Specified by:
getRelationQualifier in interface IEntityRelation


Copyright © 2005 Caleigo. All Rights Reserved.