wt.step.processor.expressParser
Class EntityDefinition

java.lang.Object
  extended bywt.step.processor.expressParser.EntityDefinition

public class EntityDefinition
extends Object

The definition information for a single Entity in the ExpressSchema.
Note: There is an assumption in the attribute definitions that any attribute generated in the IDL because of an association begins with 'the__'.


Nested Class Summary
 class EntityDefinition.AttributeDefinition
           
private  class EntityDefinition.AttributesEnumeration
           
(package private)  class EntityDefinition.IndexHolder
           
 
Field Summary
private  Hashtable _attributeIndexCache
           
private  Vector _attributeNames
          Attributes declared in this entity (not inherited)
private  Vector _attributeTypes
           
private  Vector _entityLinkTypes
           
private  Vector _entityRoleLinkMechanisms
           
private  Vector _entityRoleNames
           
private  String _name
           
private  Vector _subtypeNames
          A list of subtype names.
private  Vector _typesFlattened
          A list of unique subtypes in the flattened hierarchy of subtypes.
 
Constructor Summary
EntityDefinition(String name)
           
 
Method Summary
 void addAttribute(String attributeName, String attributeType)
           
(package private)  void addEntityLink(Class linkClass)
           
private  void addMatchingTraversalMechanisms(String roleName, Vector mechanisms)
           
private  void addRole(String roleName, TraversalMechanism mechanism)
           
(package private)  boolean addRoleLink(String roleName, TraversalMechanism mechanism, ExpressSchema schema)
          Adds a role link to the entity.
 void addSubtype(String subtypeName)
           
private  void collectUniqueSubTypes(Vector collection, ExpressSchema schema)
           
 void dump()
           
private  void flattenTypeHierarchy(ExpressSchema schema)
           
 int getAttributeCount()
          A count of all the local attributes of this Entity.
 int getAttributeIndex(ExpressSchema schema, String attributeName)
          Gets the index of an attribute in this entity as it would appear in a STEP file.
 Enumeration getAttributes()
          Access all AttributeDefinitions for this Entity.
 Enumeration getEntityLinks()
           
 int getFullAttributeCount(ExpressSchema schema)
          A count of all the attributes in this Entity (including inherited).
 String getName()
           
 Enumeration getSubtypes()
           
 Vector getTraversalMechanismsForRole(ExpressSchema schema, String roleName)
           
 boolean hasEntityLink(Class linkClass)
           
 boolean hasEntityLinks()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

private String _name

_subtypeNames

private Vector _subtypeNames
A list of subtype names.


_typesFlattened

private Vector _typesFlattened
A list of unique subtypes in the flattened hierarchy of subtypes.


_attributeNames

private Vector _attributeNames
Attributes declared in this entity (not inherited)


_attributeTypes

private Vector _attributeTypes

_entityLinkTypes

private Vector _entityLinkTypes

_entityRoleNames

private Vector _entityRoleNames

_entityRoleLinkMechanisms

private Vector _entityRoleLinkMechanisms

_attributeIndexCache

private Hashtable _attributeIndexCache
Constructor Detail

EntityDefinition

public EntityDefinition(String name)
Method Detail

addSubtype

public void addSubtype(String subtypeName)

addAttribute

public void addAttribute(String attributeName,
                         String attributeType)

getName

public String getName()

getSubtypes

public Enumeration getSubtypes()

getAttributes

public Enumeration getAttributes()
Access all AttributeDefinitions for this Entity.


addEntityLink

void addEntityLink(Class linkClass)

addRoleLink

boolean addRoleLink(String roleName,
                    TraversalMechanism mechanism,
                    ExpressSchema schema)
Adds a role link to the entity. The role name must match one of this entities 'declared' attributes. If not then it is passed to subtypes.

Returns:
true if an attribute matched the roleName and the mechanism was recorded. false usually shows an error has occurred.

addRole

private void addRole(String roleName,
                     TraversalMechanism mechanism)

getTraversalMechanismsForRole

public Vector getTraversalMechanismsForRole(ExpressSchema schema,
                                            String roleName)
                                     throws TransferException
Throws:
TransferException

addMatchingTraversalMechanisms

private void addMatchingTraversalMechanisms(String roleName,
                                            Vector mechanisms)

flattenTypeHierarchy

private void flattenTypeHierarchy(ExpressSchema schema)

collectUniqueSubTypes

private void collectUniqueSubTypes(Vector collection,
                                   ExpressSchema schema)

hasEntityLinks

public boolean hasEntityLinks()

getEntityLinks

public Enumeration getEntityLinks()

hasEntityLink

public boolean hasEntityLink(Class linkClass)

getAttributeCount

public int getAttributeCount()
A count of all the local attributes of this Entity.


getFullAttributeCount

public int getFullAttributeCount(ExpressSchema schema)
A count of all the attributes in this Entity (including inherited).


getAttributeIndex

public int getAttributeIndex(ExpressSchema schema,
                             String attributeName)
Gets the index of an attribute in this entity as it would appear in a STEP file. That is a flattened/unique subtype hierarchy, depth first.


dump

public void dump()