VdexReload 1.1.3 API

uk.ac.reload.moonunit.schema
Class ReloadSchema

java.lang.Object
  extended byuk.ac.reload.moonunit.schema.ReloadSchema

public class ReloadSchema
extends java.lang.Object

The ReloadSchema Class - a Java representation of an XML Schema. Together with certain XML Schema helper files an XML Schema is read in, parsed and constructed in memory as a hierarchical linked list of ReloadSchemaNode objects - ReloadSchemaElement and ReloadSchemaAttribute.

It relies on Castor (www.castor.org) and JDOM (www.jdom.org) to do the donkey work.


Field Summary
protected  org.exolab.castor.xml.schema.Schema _castorSchema
          The Castor Schema that we will query.
 
Method Summary
protected  org.exolab.castor.xml.schema.Schema getCastorSchema()
          Get the raw Castor Schema
 java.lang.String getNamespaceURI(java.lang.String prefix)
          Returns the namespace URI associated with the given prefix.
static ReloadSchema getReloadSchema(java.io.File fileSpec, java.lang.String rootName)
          Factory method for getting a static re-usable ReloadSchema
 ReloadSchemaElement getRootElement()
          Get the root element
 java.lang.String getRootElementName()
          Get the name of the Root Element in this Schema
 java.lang.String getSchemaLocation()
          Returns the full absolute path schemaLocation hint provided for this schema
 java.lang.String getSchemaLocation(java.lang.String namespaceURI)
          Get the schemaLocation for a given Namespace URI
 java.lang.String getSchemaName()
          Returns the short schemaLocation hint provided of this schema
 java.lang.String getSchemaName(java.lang.String namespaceURI)
          Get the short schemaLocation for a given Namespace URI
 java.lang.String getSchemaNamespace()
          Returns the namespace of the XML Schema Note: This is not the same as targetNamespace.
 java.lang.String getTargetNamespace()
          Returns the target namespace for this Schema, or null if no namespace has been defined.
protected  org.exolab.castor.xml.schema.Schema loadCastorSchema(java.io.File schemaFile)
          Load the Castor Schema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_castorSchema

protected org.exolab.castor.xml.schema.Schema _castorSchema
The Castor Schema that we will query.

Method Detail

getReloadSchema

public static ReloadSchema getReloadSchema(java.io.File fileSpec,
                                           java.lang.String rootName)
                                    throws ReloadSchemaException
Factory method for getting a static re-usable ReloadSchema

Parameters:
fileSpec - The file of the Specification Schema XSD to get
rootName - We need to know the root name element. This is found in the Helper file.
Returns:
The ReloadSchema or null if not found
Throws:
ReloadSchemaException - if something goes wrong

getRootElement

public ReloadSchemaElement getRootElement()
Get the root element

Returns:
The root ReloadSchemaElement

getRootElementName

public java.lang.String getRootElementName()
Get the name of the Root Element in this Schema

Returns:
The Root Element Name

getTargetNamespace

public java.lang.String getTargetNamespace()
Returns the target namespace for this Schema, or null if no namespace has been defined.

Returns:
the target namespace for this Schema, or null if no namespace has been defined

getSchemaNamespace

public java.lang.String getSchemaNamespace()
Returns the namespace of the XML Schema Note: This is not the same as targetNamespace. This is the namespace of "XML Schema" itself and not the namespace of the schema that is represented by this object model

Returns:
the namespace of the XML Schema

getSchemaLocation

public java.lang.String getSchemaLocation()
Returns the full absolute path schemaLocation hint provided for this schema

Returns:
the schemaLocation hint provided of this schema

getSchemaLocation

public java.lang.String getSchemaLocation(java.lang.String namespaceURI)
Get the schemaLocation for a given Namespace URI

Returns:
the schemaLocation for a given Namespace URI

getSchemaName

public java.lang.String getSchemaName()
Returns the short schemaLocation hint provided of this schema

Returns:
the schemaLocation hint provided of this schema

getSchemaName

public java.lang.String getSchemaName(java.lang.String namespaceURI)
Get the short schemaLocation for a given Namespace URI

Returns:
the short schemaLocation for a given Namespace URI, or null if no assoficate namespace URI exists.

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String prefix)
Returns the namespace URI associated with the given prefix.

Returns:
the namespace associated with the given prefix, or null if no associated namespace exists.

getCastorSchema

protected org.exolab.castor.xml.schema.Schema getCastorSchema()
Get the raw Castor Schema

Returns:
The Castor Schema

loadCastorSchema

protected org.exolab.castor.xml.schema.Schema loadCastorSchema(java.io.File schemaFile)
                                                        throws java.io.IOException
Load the Castor Schema

Parameters:
schemaFile - The XML Schema File
Returns:
The Castor Schema
Throws:
java.io.IOException

VdexReload 1.1.3 API