org.exolab.castor.xml.schema.reader
Class SchemaReader
java.lang.Object
org.exolab.castor.xml.schema.reader.SchemaReader
public class SchemaReader
extends java.lang.Object
A class for reading XML Schemas.
$Revision: 7410 $ $Date: 2004-10-05 14:27:10 -0600 (Tue, 05 Oct 2004) $SchemaReader() - New style how to create a SchemaReader instance, requiring that
SchemaContext
and InputSource are set before calling read .
|
SchemaReader(InputSource source) - Creates a new SchemaReader for the given InputSource
|
SchemaReader(Reader reader, String filename) - Creates a new SchemaReader for the given Reader
|
SchemaReader(String url) - Creates a new SchemaReader for the given URL
|
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(EntityResolver resolver) - Sets the EntityResolver used to resolve SYSTEM Identifier.
|
void | setErrorHandler(ErrorHandler errorHandler) - Sets the ErrorHandler.
|
void | setInputSource(InputSource inputSource) - A different way to create a SchemaReader by using an empty constructor and
setting the InputSource afterwards.
|
void | setSchemaContext(SchemaContext schemaContext) - To set the
SchemaContext to be used.
|
void | setURIResolver(URIResolver uriresolver) - Sets the URIResolver used to resolve hrefs.
|
void | setValidation(boolean validate) - Sets whether or not post-read validation should
occur.
|
SchemaReader
public SchemaReader()
New style how to create a SchemaReader instance, requiring that
SchemaContext
and InputSource are set before calling
read
.
SchemaReader
public SchemaReader(InputSource source)
throws IOException
Creates a new SchemaReader for the given InputSource
source
- the InputSource to read the Schema from.
SchemaReader
public SchemaReader(Reader reader,
String filename)
throws IOException
Creates a new SchemaReader for the given Reader
reader
- the Reader to read the Schema from.filename
- for reporting errors.
SchemaReader
public SchemaReader(String url)
throws IOException
Creates a new SchemaReader for the given URL
read
public Schema read()
throws 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.
- the new Schema created from the source of this SchemaReader
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.
cache
- true to cache the included XML Schemas.
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
Sets the EntityResolver used to resolve SYSTEM Identifier.
If the entity resolver is null, the default one will be used.
resolver
- the EntityResolver to use.
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Sets the ErrorHandler.
setInputSource
public void setInputSource(InputSource inputSource)
A different way to create a SchemaReader by using an empty constructor and
setting the InputSource afterwards.
inputSource
- the InputSource to read the schema from
setSchemaContext
public void setSchemaContext(SchemaContext schemaContext)
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.
uriresolver
- the URIResolver to use.
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.
validate
- a boolean that when true will force
a call to Schema#validate after the schema is read.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com