org.exolab.castor.xml.schema.reader
Class SchemaReader

java.lang.Object
  extended by org.exolab.castor.xml.schema.reader.SchemaReader

public class SchemaReader
extends java.lang.Object

A class for reading XML Schemas

Version:
$Revision: 1.5 $ $Date: 2004/10/05 20:27:10 $
Author:
Keith Visco

Constructor Summary
SchemaReader(org.xml.sax.InputSource source)
          Creates a new SchemaReader for the given InputSource
SchemaReader(java.io.Reader reader, java.lang.String filename)
          Creates a new SchemaReader for the given Reader
SchemaReader(java.lang.String url)
          Creates a new SchemaReader for the given URL
 
Method Summary
 Schema read()
          Reads the Schema from the source and returns the Schema object model.
 void setCacheIncludedSchemas(boolean cache)
          Sets wheter or not to cache the included xml schemas instead of inlining them as specified by the XML Schema specification.
 void setEntityResolver(org.xml.sax.EntityResolver resolver)
          Sets the EntityResolver used to resolve SYSTEM Identifier.
 void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
          Sets the ErrorHandler.
 void setURIResolver(URIResolver uriresolver)
          Sets the URIResolver used to resolve hrefs.
 void setValidation(boolean validate)
          Sets whether or not post-read validation should occur.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaReader

public SchemaReader(org.xml.sax.InputSource source)
             throws java.io.IOException
Creates a new SchemaReader for the given InputSource

Parameters:
source - the InputSource to read the Schema from.
Throws:
java.io.IOException

SchemaReader

public SchemaReader(java.io.Reader reader,
                    java.lang.String filename)
             throws java.io.IOException
Creates a new SchemaReader for the given Reader

Parameters:
reader - the Reader to read the Schema from.
filename - for reporting errors.
Throws:
java.io.IOException

SchemaReader

public SchemaReader(java.lang.String url)
             throws java.io.IOException
Creates a new SchemaReader for the given URL

Parameters:
url - the URL string
Throws:
java.io.IOException
Method Detail

read

public Schema read()
            throws java.io.IOException
Reads the Schema from the source and returns the Schema object model.
Note: Subsequent calls to this method will simply return a cached copy of the Schema object. To read a new Schema object, create a new Reader.

Returns:
the new Schema created from the source of this SchemaReader
Throws:
java.io.IOException

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets the ErrorHandler.

Parameters:
ErrorHandler. -

setCacheIncludedSchemas

public void setCacheIncludedSchemas(boolean cache)
Sets wheter or not to cache the included xml schemas instead of inlining them as specified by the XML Schema specification.

Parameters:
cache - true to cache the included XML Schemas.

setValidation

public void setValidation(boolean validate)
Sets whether or not post-read validation should occur. By default, validation is enabled. Note that certain read validation cannot be disabled.

Parameters:
validate - a boolean that when true will force a call to Schema#validate after the schema is read.

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets the EntityResolver used to resolve SYSTEM Identifier. If the entity resolver is null, the default one will be used.

Parameters:
resolver - the EntityResolver to use.

setURIResolver

public void setURIResolver(URIResolver uriresolver)
Sets the URIResolver used to resolve hrefs. If the entity resolver is null, the default one will be used.

Parameters:
resolver - the URIResolver to use.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com