wt.step.schemaGenerator
Class Schema

java.lang.Object
  extended bywt.step.schemaGenerator.Schema
Direct Known Subclasses:
IntrospectedSchema

class Schema
extends Object

A schema constructed by parsing IDL files


Field Summary
private  Vector _entities
           
private  Hashtable _entitiesTable
           
private  EntityDefinition _latestEntity
           
private  String _name
           
private static Object _TYPE_DEFINED
           
private static Object _TYPE_USED
           
private  Vector _types
           
private  Hashtable _typeUsageTable
           
 
Constructor Summary
(package private) Schema(String name)
           
 
Method Summary
(package private)  void addEntity(EntityDefinition entity)
           
(package private)  void addEntity(String entityName)
          Add an ENTITY definition to the schema
(package private)  void addEntityAttribute(EntityDefinition entity, String name, String type, boolean nativeType)
           
(package private)  void addEntitySubtype(EntityDefinition entity, String subtype)
           
(package private)  void addLatestEntityAttribute(String name, String type, boolean nativeType)
          Add an atttribute to the latest Entity that was added.
(package private)  void addLatestEntitySubtype(String subtype)
          Add a subtype to the latest Entity that was added
(package private)  void addType(String name, String definition)
          Add a TYPE definition to the schema
(package private)  void collectEntityAttributes(String entityName, Hashtable attributesHolder)
          Collect all the inherited attributes for each entity.
protected  Enumeration getDefinedEntities()
           
protected  Enumeration getDefinedTypes()
           
protected  String getFilename()
           
protected  boolean isDefinedType(String typeName)
           
(package private)  void markInheritedAttributes()
          For each Entity in the schema mark any inherited attributes Note: This should be called after removeAttributeNameClashes as names may be changed by that routine.
private  void recordTypeDefinition(String typename)
          Record a type definition so that undefined (but referenced) types can be found.
private  void recordTypeUsage(String typename)
          Records the usage of a type so that undefined references can later be stubbed to ensure that the generated schema is fully consistent.
(package private)  void removeAttributeNameClashes()
          For each Entity in the schema remove any attribute name clashes
(package private)  void writeExpress(PrintStream outStream)
          Write the entire schema to the given print stream in the Express language.
 void writeUndefinedTypes(PrintStream outStream)
          Write stubs for types that have been referenced but not defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_typeUsageTable

private Hashtable _typeUsageTable

_TYPE_DEFINED

private static final Object _TYPE_DEFINED

_TYPE_USED

private static final Object _TYPE_USED

_name

private String _name

_types

private Vector _types

_entities

private Vector _entities

_entitiesTable

private Hashtable _entitiesTable

_latestEntity

private EntityDefinition _latestEntity
Constructor Detail

Schema

Schema(String name)
Method Detail

getFilename

protected String getFilename()

addType

void addType(String name,
             String definition)
Add a TYPE definition to the schema


addEntity

void addEntity(String entityName)
Add an ENTITY definition to the schema


addEntity

void addEntity(EntityDefinition entity)

addLatestEntityAttribute

void addLatestEntityAttribute(String name,
                              String type,
                              boolean nativeType)
Add an atttribute to the latest Entity that was added.


addEntityAttribute

void addEntityAttribute(EntityDefinition entity,
                        String name,
                        String type,
                        boolean nativeType)

addLatestEntitySubtype

void addLatestEntitySubtype(String subtype)
Add a subtype to the latest Entity that was added


addEntitySubtype

void addEntitySubtype(EntityDefinition entity,
                      String subtype)

removeAttributeNameClashes

void removeAttributeNameClashes()
For each Entity in the schema remove any attribute name clashes

See Also:
wt.step.schemaGenerator.EntityDefinition.removeAttributeNameClashes

markInheritedAttributes

void markInheritedAttributes()
For each Entity in the schema mark any inherited attributes Note: This should be called after removeAttributeNameClashes as names may be changed by that routine.

See Also:
wt.step.schemaGenerator.EntityDefinition.markInheritedAttributes

collectEntityAttributes

void collectEntityAttributes(String entityName,
                             Hashtable attributesHolder)
Collect all the inherited attributes for each entity.


writeExpress

void writeExpress(PrintStream outStream)
Write the entire schema to the given print stream in the Express language.


getDefinedEntities

protected Enumeration getDefinedEntities()

getDefinedTypes

protected Enumeration getDefinedTypes()

recordTypeUsage

private void recordTypeUsage(String typename)
Records the usage of a type so that undefined references can later be stubbed to ensure that the generated schema is fully consistent.


recordTypeDefinition

private void recordTypeDefinition(String typename)
Record a type definition so that undefined (but referenced) types can be found.


isDefinedType

protected boolean isDefinedType(String typeName)

writeUndefinedTypes

public void writeUndefinedTypes(PrintStream outStream)
Write stubs for types that have been referenced but not defined.