org.exolab.castor.xml.schema.reader

Class SchemaReader


public class SchemaReader
extends java.lang.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

Schema
read()
Reads the Schema from the source and returns the Schema object model.
void
setEntityResolver(EntityResolver resolver)
Sets the EntityResolver used to resolve SYSTEM Identifier.
void
setURIResolver(URIResolver uriresolver)
Sets the URIResolver used to resolve hrefs.
void
setValidation(boolean validate)
Sets whether or not post-read validation should occur.

Constructor Details

SchemaReader

public SchemaReader(InputSource source)
            throws IOException
Creates a new SchemaReader for the given InputSource
Parameters:
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
Parameters:
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
Parameters:
url - the URL string

Method Details

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.
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:

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