org.oreodata.metadata
Class TupleMetadata

java.lang.Object
  |
  +--org.oreodata.metadata.TupleMetadata
All Implemented Interfaces:
RecordDescriptor, java.io.Serializable

public abstract class TupleMetadata
extends java.lang.Object
implements RecordDescriptor

An implementation of the RecordDescriptor interface. This class knows how to instantiate itself from a DOM Element

Author:
Jonathan Revusky
See Also:
Serialized Form

Constructor Summary
TupleMetadata()
           
 
Method Summary
 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()
           
 int indexOf(java.lang.String fieldname)
           
 Record newRecord()
           
 int size()
          The number of fields in the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.oreodata.RecordDescriptor
createSAXHandler, createSAXHandler, hasExternallySetValues
 

Constructor Detail

TupleMetadata

public TupleMetadata()
Method Detail

getField

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

getField

public FieldDescriptor getField(int i)
Specified by:
getField in interface RecordDescriptor
Returns:
the FieldDescriptor based on ordinal index.

getFieldDescriptors

public java.util.Enumeration getFieldDescriptors()
Specified by:
getFieldDescriptors in interface RecordDescriptor
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.

size

public int size()
Description copied from interface: RecordDescriptor
The number of fields in the record.

Specified by:
size in interface RecordDescriptor

indexOf

public int indexOf(java.lang.String fieldname)
Specified by:
indexOf in interface RecordDescriptor
Parameters:
fieldname - the name of the field or an alias
Returns:
the index of the field of a given name, or -1 if it does not exist.

getPresentationWrapperClass

public java.lang.Class getPresentationWrapperClass()
Specified by:
getPresentationWrapperClass in interface RecordDescriptor
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.

getPrimaryKeyField

public FieldDescriptor getPrimaryKeyField()
Specified by:
getPrimaryKeyField in interface RecordDescriptor
Returns:
the FieldDescriptor for the primary key.

getRecordClass

public java.lang.Class getRecordClass()
Specified by:
getRecordClass in interface RecordDescriptor
Returns:
the Java class that corresponds to this record type.

newRecord

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

getType

public java.lang.String getType()
Specified by:
getType in interface RecordDescriptor
Returns:
a string representing the type of record this is.

getTableName

public java.lang.String getTableName()
Specified by:
getTableName in interface RecordDescriptor
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.

getProperty

public java.lang.String getProperty(java.lang.String propertyName)
Description copied from interface: RecordDescriptor
a hook so that implementors can add other properties

Specified by:
getProperty in interface RecordDescriptor