|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.xerox.bantam.Schema
A Schema object is an immutable representation of a Bantam schema.
The Schema object allows the user to specify the enforcement of
both the presence and type of document properties. To define a schema in
code, create a subclass of Schema according to the following guidelines:
To enable efficient validation of Schema objects when they are passed in Bantam methods, Schema objects must be immmutable. This is the reason why subclasses are not permitted to override getFields() or to access internal field records.
| Inner Class Summary | |
protected class |
Schema.fieldCompare
Comparator for partial ordering by field name This comparator is inconsistent with equals for FieldDescriptor |
| Field Summary | |
protected String |
name
Name of the schema. |
protected long |
version
Version of the schema. |
| Constructor Summary | |
protected |
Schema()
Constructor for subclasses which define a schema in code. |
|
Schema(String schemaName,
FieldDescriptor[] f)
Construct from field descriptors. |
| Method Summary | |
boolean |
equals(Object obj)
Equality test |
FieldDescriptor[] |
getFields()
Return all field definitions in the schema |
String |
getName()
Return schema name. |
static Schema |
getSchema(Class clazz)
Retrieve the canonical instance of a schema by class |
static Schema |
getSchema(String name)
Retrieve the canonical instance of a schema by name |
static List |
getSchemaFields(Class clazz)
Get all the FieldDescriptors from clazz which are used to describe the schema they represent. |
long |
getVersion()
Return a version stamp which is a signature value for this schema. |
Schema |
parse(String text)
Create a Schema from a text definition |
int |
size()
Return the number of entries in this schema. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected String name
protected long version
| Constructor Detail |
protected Schema()
public Schema(String schemaName,
FieldDescriptor[] f)
| Method Detail |
public static List getSchemaFields(Class clazz)
public static Schema getSchema(Class clazz)
name - the name of the schema to retrievepublic static Schema getSchema(String name)
name - the name of the schema to retrievepublic int size()
public String getName()
public long getVersion()
public final FieldDescriptor[] getFields()
public final String toString()
toString in class Objectpublic Schema parse(String text)
public boolean equals(Object obj)
equals in class Object
|
Project Harland | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||