org.exolab.castor.xml.schema.reader

Class SchemaReader

public class SchemaReader extends Object

A class for reading XML Schemas

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:41 $

Author: Keith Visco

Constructor Summary
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
Method Summary
Schemaread()
Reads the Schema from the source and returns the Schema object model.
voidsetEntityResolver(EntityResolver resolver)
Sets the EntityResolver used to resolve SYSTEM Identifier.
voidsetURIResolver(URIResolver uriresolver)
Sets the URIResolver used to resolve hrefs.
voidsetValidation(boolean validate)
Sets whether or not post-read validation should occur.

Constructor Detail

SchemaReader

public SchemaReader(InputSource source)
Creates a new SchemaReader for the given InputSource

Parameters: source the InputSource to read the Schema from.

SchemaReader

public SchemaReader(Reader reader, String filename)
Creates a new SchemaReader for the given Reader

Parameters: reader the Reader to read the Schema from. filename for reporting errors.

SchemaReader

public SchemaReader(String url)
Creates a new SchemaReader for the given URL

Parameters: url the URL string

Method Detail

read

public Schema read()
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

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.

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.

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.

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