|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ispheres.shared.core.Schema
public class Schema
The Schema object contains the metadata scheme which is read from a metadata schema file stored in XML. This can be used to validate metadata information entered to the actual metadata scheme that is being used.
| Constructor Summary | |
|---|---|
Schema()
Default constructor for Schema object which creates an empty instance of a schema. |
|
Schema(java.io.File schemaFile)
Constructs the Schema object based on the specified schema file. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Checks whether this Schema is equal to another Schema object and returns true when it is. |
java.lang.String |
getContentType()
Returns the Content-Type that is used for Schema objects for transfer using SOAP. |
java.util.ArrayList<java.lang.Integer> |
getDescriptionElements()
Returns the list of elements that make up the description of a MetadataObject in this schema. |
java.lang.Integer |
getElementId(java.lang.String elementName)
Returns the unique identifier of the element with the specified name. |
int[] |
getElementIds(java.lang.String[] elementNames)
Retrieves a list of unique identifiers for the elements with the specified names, or throws a NoSuchElementException when one of the specified elements does not exist. |
java.lang.String |
getElementName(int elementId)
Returns the name or tag of the element with the specified unique identifier. |
java.util.Map<java.lang.Integer,Element> |
getElements()
Returns the mapping of unique identifiers of elements to the actual Element objects. |
java.io.File |
getFile()
Returns the filename of the file in which the metadata schema is stored. |
java.util.ArrayList<java.lang.Integer> |
getObjectLocationElements()
Returns the list of unique identifiers for the elements that specify the location of the digital object that accompanies MetadataObjects using this Schema. |
java.util.Map<java.lang.Integer,Scheme> |
getSchemes()
Returns the mapping of unique identifiers of schemes to the actual Scheme objects. |
int |
getTitleElement()
Returns the unique identifier of the element that makes up the title of a MetadataObject in this schema. |
boolean |
hasElement(int elementId)
Returns whether the schema defines an element with the specified unique identifier. |
boolean |
hasElement(java.lang.String elementName)
Returns whether the schema has an element with the specified name. |
int |
hashCode()
Calculates the hascode for this Schema object. |
void |
populateObject(byte[] serialisedObject)
Recreates the Schema object based on the data contained in the supplied array of bytes. |
byte[] |
serialiseObject()
Creates a serialised form of the Schema object, which is really just a read of the schema file this Schema object was constructed from. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Schema()
public Schema(java.io.File schemaFile)
throws java.io.IOException
schemaFile - A File object representing the schema XML file.
java.io.IOException - Thrown when the file could not be read.| Method Detail |
|---|
public final java.io.File getFile()
public final java.lang.Integer getElementId(java.lang.String elementName)
elementName - The name of the element to search for.
public final int[] getElementIds(java.lang.String[] elementNames)
elementNames - A String array containing names of elements
defined within this schema.
public final java.lang.String getElementName(int elementId)
elementId - The unique identifier of the element to
search for.
public final boolean hasElement(java.lang.String elementName)
elementName - The name of the element to look for.
public final boolean hasElement(int elementId)
elementId - The element identifier to search for.
public final java.util.Map<java.lang.Integer,Element> getElements()
public final java.util.Map<java.lang.Integer,Scheme> getSchemes()
public final java.util.ArrayList<java.lang.Integer> getObjectLocationElements()
public final int getTitleElement()
public final java.util.ArrayList<java.lang.Integer> getDescriptionElements()
public final boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - The Object to compare this Schema with.
public final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String getContentType()
public final void populateObject(byte[] serialisedObject)
throws DigitalObjectException
serialisedObject - A byte array containing the serialised form of
the Schema object.
DigitalObjectExceptionpublic final byte[] serialiseObject()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||