kaos.xmlschema.repository
Class XMLRepositoryImpl

java.lang.Object
  extended by kaos.xmlschema.repository.XMLRepositoryImpl
All Implemented Interfaces:
XMLRepository

public class XMLRepositoryImpl
extends java.lang.Object
implements XMLRepository

This class defines the methods that allow to store and retrieve XMLSchema definitions $Revision: 1.14 $


Constructor Summary
XMLRepositoryImpl()
          Empty constructor
 
Method Summary
 java.util.List<XMLSchemaContainer> getAllSchema()
          Retrieve all schemas in the repository.
 java.util.List<java.lang.String> getSchema(java.lang.String dataName)
          Retrieve the schema for the given data type.
 void loadSchema(java.lang.String fileName)
          Load schema definitions of data types from a file.
 void putMultipleSchema(java.util.List<XMLSchemaContainer> schemaList)
          Store multiple schemas in the repository.
 void putSchema(java.lang.String dataName, java.lang.String dataSchema)
          Store the given schema definition under the name of that user defined data type
 void removeSchema(java.lang.String dataName)
          Remove the schema for the given data type from this repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLRepositoryImpl

public XMLRepositoryImpl()
Empty constructor

Method Detail

putMultipleSchema

public void putMultipleSchema(java.util.List<XMLSchemaContainer> schemaList)
Store multiple schemas in the repository.

Specified by:
putMultipleSchema in interface XMLRepository
Parameters:
schemaList - a list containing XMLSchemaContainer objects.

getAllSchema

public java.util.List<XMLSchemaContainer> getAllSchema()
Retrieve all schemas in the repository.

Specified by:
getAllSchema in interface XMLRepository
Returns:
list containing XMLSchemaContainer objects.

putSchema

public void putSchema(java.lang.String dataName,
                      java.lang.String dataSchema)
Store the given schema definition under the name of that user defined data type

Specified by:
putSchema in interface XMLRepository
Parameters:
dataName - the name of the defined data type.

getSchema

public java.util.List<java.lang.String> getSchema(java.lang.String dataName)
                                           throws org.relaxng.datatype.DatatypeException
Retrieve the schema for the given data type. Please note that a derived data type can have as its parent a data type which is also derived from some other data type. hence the method returns a vector, containing schema definitions for all such data types in the hierarchy.

Specified by:
getSchema in interface XMLRepository
Parameters:
dataName - the name of the data type to be retrieved
Returns:
a vector containing all the data type definitions in the chain of inheritance.
Throws:
org.relaxng.datatype.DatatypeException

removeSchema

public void removeSchema(java.lang.String dataName)
                  throws org.relaxng.datatype.DatatypeException
Remove the schema for the given data type from this repository.

Specified by:
removeSchema in interface XMLRepository
Parameters:
dataName - the name of the data type to be removed.
Throws:
org.relaxng.datatype.DatatypeException

loadSchema

public void loadSchema(java.lang.String fileName)
                throws org.relaxng.datatype.DatatypeException
Load schema definitions of data types from a file.

Specified by:
loadSchema in interface XMLRepository
Parameters:
fileName - the name of the file or the url that stores schema definitions
Throws:
org.relaxng.datatype.DatatypeException