org.oreodata
Interface RecordDescriptor

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
JoinMetadata, RecordMetadata, TupleMetadata

public interface RecordDescriptor
extends java.io.Serializable

A metadata object that describes what is in a record.

Author:
Jonathan Revusky

Method Summary
 XMLRecordHandler createSAXHandler(HierarchicalHandler parent, Record rec, boolean recurse)
          Create a SAX Handler that fills in a record based on SAX events.
 XMLRecordHandler createSAXHandler(org.xml.sax.XMLReader parser, Record rec, boolean recurse)
          Create a SAX Handler that fills in a record based on SAX events.
 FieldDescriptor getField(int i)
           
 FieldDescriptor getField(java.lang.String name)
           
 java.util.Enumeration getFieldDescriptors()
           
 java.lang.Class getPresentationWrapperClass()
           
 FieldDescriptor getPrimaryKeyField()
           
 java.lang.String getProperty(java.lang.String propertyName)
          a hook so that implementors can add other properties
 java.lang.Class getRecordClass()
           
 java.lang.String getTableName()
           
 java.lang.String getType()
           
 boolean hasExternallySetValues()
           
 int indexOf(java.lang.String name)
           
 Record newRecord()
           
 int size()
          The number of fields in the record.
 

Method Detail

getType

public java.lang.String getType()
Returns:
a string representing the type of record this is.

getFieldDescriptors

public java.util.Enumeration getFieldDescriptors()
Returns:
a java.util.Enumeration of the descriptors of the fields that comprise this record. NB: For a variety of hypertechnical reasons, it is required that the primary key field be the first field that comes out of the enumeration.

getField

public FieldDescriptor getField(java.lang.String name)
Returns:
the FieldDescriptor based on name, or null if none is found.

getField

public FieldDescriptor getField(int i)
Returns:
the FieldDescriptor based on ordinal index.

getPrimaryKeyField

public FieldDescriptor getPrimaryKeyField()
Returns:
the FieldDescriptor for the primary key.

indexOf

public int indexOf(java.lang.String name)
Returns:
the ordinal index of the field of the given name, -1 if there is no field of that name.

size

public int size()
The number of fields in the record.


getPresentationWrapperClass

public java.lang.Class getPresentationWrapperClass()
Returns:
a custom class that is used to "wrap" this record for presentation. I anticipate that many (if not most) implementations will simply return null here and a default wrapper class will be used.

getRecordClass

public java.lang.Class getRecordClass()
Returns:
the Java class that corresponds to this record type.

newRecord

public Record newRecord()
Returns:
a Record that corresponds to this record descriptor in its default uninitialized state.

getTableName

public java.lang.String getTableName()
Returns:
the name of the table in which this record type is stored in a backing RDBMS. Under most circumstances, this will return the same as getType(), since there is little reason not to name the table the same as the underlying type.

createSAXHandler

public XMLRecordHandler createSAXHandler(HierarchicalHandler parent,
                                         Record rec,
                                         boolean recurse)
Create a SAX Handler that fills in a record based on SAX events.


createSAXHandler

public XMLRecordHandler createSAXHandler(org.xml.sax.XMLReader parser,
                                         Record rec,
                                         boolean recurse)
Create a SAX Handler that fills in a record based on SAX events.


getProperty

public java.lang.String getProperty(java.lang.String propertyName)
a hook so that implementors can add other properties


hasExternallySetValues

public boolean hasExternallySetValues()
Returns:
whether this record type has values that are set externally -- when a data is inserted or updated.