org.exolab.castor.xml.schema.reader

Class SaxUnmarshaller

public abstract class SaxUnmarshaller extends Object implements DocumentHandler, ErrorHandler

The base class for unmarshallers

Version: $Revision: 5951 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $

Author: Keith Visco

Field Summary
protected Locator_locator
The document locator
Constructor Summary
SaxUnmarshaller()
Method Summary
voidcharacters(char[] ch, int start, int length)
abstract StringelementName()
Returns the name of the element that this SaxUnmarshaller handles
voidendDocument()
voidendElement(String name)
voiderror(String err)
This method is called for a general error.
voiderror(SAXParseException exception)
voidfatalError(SAXParseException exception)
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.
voidignorableWhitespace(char[] ch, int start, int length)
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
voidprocessingInstruction(String target, String data)
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
voidstartDocument()
voidstartElement(String name, AttributeList atts)
static inttoInt(String str)
Converts the given String to an int
voidwarning(SAXParseException exception)

Field Detail

_locator

protected Locator _locator
The document locator

Constructor Detail

SaxUnmarshaller

public SaxUnmarshaller()

Method Detail

characters

public void characters(char[] ch, int start, int length)

elementName

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

Returns: the name of the element that this SaxUnmarshaller handles

endDocument

public void endDocument()

endElement

public void endElement(String name)

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.

error

public void error(SAXParseException exception)

fatalError

public void fatalError(SAXParseException exception)

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.

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)

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.

processingInstruction

public void processingInstruction(String target, String data)

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

startDocument

public void startDocument()

startElement

public void startElement(String name, AttributeList atts)

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

warning

public void warning(SAXParseException exception)
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com