org.exolab.castor.xml.schema.reader

Class ComponentReader

public abstract class ComponentReader extends Object

The base class for separate component unmarshallers for reading an XML Schema component.

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

Author: Keith Visco

Field Summary
protected Locator_locator
The document locator
Constructor Summary
ComponentReader()
Method Summary
voidcharacters(char[] chars, int start, int length)
Signals to recieve charactes
abstract StringelementName()
Returns the name of the element that this ComponentReader handles
voidendElement(String name, String namespace)
Signals to end of the element with the given name.
voiderror(String err)
This method is called for a general error.
voidfinish()
Called to signal an end of unmarshalling.
LocatorgetDocumentLocator()
abstract ObjectgetObject()
Returns the Object created by this Unmarshaller
ResolvergetResolver()
Returns the resolver used for resolving id references.
URIResolvergetURIResolver()
Returns the URIresolver used for resolving hrefs.
voidillegalAttribute(String attName)
This method is called when an illegal Attribute is encountered.
voidillegalElement(String name)
This method is called when an illegal Element is encountered.
static booleanisWhiteSpace(char[] chars, int start, int length)
Determines if the given sequence of characters consists of whitespace characters
voidoutOfOrder(String name)
This method is called when an out of order element is encountered
voidredefinedElement(String name)
This method is called when an element which may only be defined once, is redefined.
voidredefinedElement(String name, String xtraInfo)
This method is called when an element which may only be defined once, is redefined.
voidsetDocumentLocator(Locator locator)
voidsetResolver(Resolver resolver)
Sets the Resolver to be used for resolving id references
voidsetURIResolver(URIResolver uriResolver)
Sets the URIResolver to be used for resolving hrefs.
voidstartElement(String name, String namespace, AttributeSet atts, Namespaces nsDecls)
Signals the start of an element with the given name.
static inttoInt(String str)
Converts the given String to an int

Field Detail

_locator

protected Locator _locator
The document locator

Constructor Detail

ComponentReader

public ComponentReader()

Method Detail

characters

public void characters(char[] chars, int start, int length)
Signals to recieve charactes

Parameters: chars the character array containing the characters start the starting index into the character array length the number of characters to recieve

elementName

public abstract String elementName()
Returns the name of the element that this ComponentReader handles

Returns: the name of the element that this ComponentReader handles

endElement

public void endElement(String name, String namespace)
Signals to end of the element with the given name.

Parameters: name the NCName of the element. It is an error if the name is a QName (ie. contains a prefix). namespace the namespace of the element.

error

public void error(String err)
This method is called for a general error.

Parameters: err the error message to report

Throws: org.xml.sax.SAXException always thrown.

finish

public void finish()
Called to signal an end of unmarshalling. This method should be overridden to perform any necessary clean up by an unmarshaller

getDocumentLocator

public Locator getDocumentLocator()

getObject

public abstract Object getObject()
Returns the Object created by this Unmarshaller

Returns: the Object created by this Unmarshaller

getResolver

public Resolver getResolver()
Returns the resolver used for resolving id references.

Returns: the resolver used for resolving id references.

getURIResolver

public URIResolver getURIResolver()
Returns the URIresolver used for resolving hrefs.

Returns: the URIresolver used for resolving hrefs.

illegalAttribute

public void illegalAttribute(String attName)
This method is called when an illegal Attribute is encountered.

Parameters: attName the name of the illegal attribute.

Throws: org.xml.sax.SAXException always thrown.

illegalElement

public void illegalElement(String name)
This method is called when an illegal Element is encountered.

Parameters: name the name of the illegal element

Throws: org.xml.sax.SAXException always thrown.

isWhiteSpace

public static boolean isWhiteSpace(char[] chars, int start, int length)
Determines if the given sequence of characters consists of whitespace characters

Parameters: chars an array of characters to check for whitespace start the start index into the character array length the number of characters to check

Returns: true if the characters specficied consist only of whitespace characters

outOfOrder

public void outOfOrder(String name)
This method is called when an out of order element is encountered

Throws: org.xml.sax.SAXException always thrown.

redefinedElement

public void redefinedElement(String name)
This method is called when an element which may only be defined once, is redefined.

Parameters: name the name of the element

Throws: org.xml.sax.SAXException always thrown.

redefinedElement

public void redefinedElement(String name, String xtraInfo)
This method is called when an element which may only be defined once, is redefined.

Parameters: name the name of the element

Throws: org.xml.sax.SAXException always thrown.

setDocumentLocator

public void setDocumentLocator(Locator locator)

setResolver

public void setResolver(Resolver resolver)
Sets the Resolver to be used for resolving id references

Parameters: resolver the Resolver to be used for resolving id references

setURIResolver

public void setURIResolver(URIResolver uriResolver)
Sets the URIResolver to be used for resolving hrefs.

Parameters: uriResolver the URIResolver to be used for resolving hrefs.

startElement

public void startElement(String name, String namespace, AttributeSet atts, Namespaces nsDecls)
Signals the start of an element with the given name.

Parameters: name the NCName of the element. It is an error if the name is a QName (ie. contains a prefix). namespace the namespace of the element. This may be null. Note: A null namespace is not the same as the default namespace unless the default namespace is also null. atts the AttributeSet containing the attributes associated with the element. nsDecls the namespace declarations being declared for this element. This may be null.

toInt

public static int toInt(String str)
Converts the given String to an int

Parameters: str the String to convert to an int

Returns: the int derived from the given String

Throws: IllegalArgumentException when the given String does not represent a valid int

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