org.exolab.castor.xml.schema.reader

Class SaxUnmarshaller

Implemented Interfaces:
DocumentHandler, org.xml.sax.ErrorHandler

public abstract class SaxUnmarshaller
extends java.lang.Object
implements DocumentHandler, org.xml.sax.ErrorHandler

The base class for unmarshallers

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

Author:
Keith Visco

Field Summary

protected Locator
_locator
The document locator

Constructor Summary

SaxUnmarshaller()

Method Summary

void
characters(char[] ch, int start, int length)
String
elementName()
Returns the name of the element that this SaxUnmarshaller handles
void
endDocument()
void
endElement(String name)
void
error(SAXParseException exception)
void
error(String err)
This method is called for a general error.
void
fatalError(SAXParseException exception)
void
finish()
Called to signal an end of unmarshalling.
Locator
getDocumentLocator()
Object
getObject()
Returns the Object created by this Unmarshaller
Resolver
getResolver()
Returns the resolver used for resolving id references.
void
ignorableWhitespace(char[] ch, int start, int length)
void
illegalAttribute(String attName)
This method is called when an illegal Attribute is encountered.
void
illegalElement(String name)
This method is called when an illegal Element is encountered.
static boolean
isWhiteSpace(char[] chars, int start, int length)
Determines if the given sequence of characters consists of whitespace characters
void
outOfOrder(String name)
This method is called when an out of order element is encountered
void
processingInstruction(String target, String data)
void
redefinedElement(String name)
This method is called when an element which may only be defined once, is redefined.
void
redefinedElement(String name, String xtraInfo)
This method is called when an element which may only be defined once, is redefined.
void
setDocumentLocator(Locator locator)
void
setResolver(Resolver resolver)
Sets the Resolver to be used for resolving id references
void
startDocument()
void
startElement(String name, AttributeList atts)
static int
toInt(String str)
Converts the given String to an int
void
warning(SAXParseException exception)

Field Details

_locator

protected Locator _locator
The document locator

Constructor Details

SaxUnmarshaller

public SaxUnmarshaller()

Method Details

characters

public void characters(char[] ch,
                       int start,
                       int length)
            throws org.xml.sax.SAXException


elementName

public 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()
            throws org.xml.sax.SAXException


endElement

public void endElement(String name)
            throws org.xml.sax.SAXException


error

public void error(SAXParseException exception)
            throws org.xml.sax.SAXException


error

public void error(String err)
            throws org.xml.sax.SAXException
This method is called for a general error.

Parameters:
err - the error message to report


fatalError

public void fatalError(SAXParseException exception)
            throws org.xml.sax.SAXException


finish

public void finish()
            throws SAXException
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 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)
            throws org.xml.sax.SAXException


illegalAttribute

public void illegalAttribute(String attName)
            throws org.xml.sax.SAXException
This method is called when an illegal Attribute is encountered.

Parameters:
attName - the name of the illegal attribute.


illegalElement

public void illegalElement(String name)
            throws org.xml.sax.SAXException
This method is called when an illegal Element is encountered.

Parameters:
name - the name of the illegal element


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)
            throws org.xml.sax.SAXException
This method is called when an out of order element is encountered


processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws org.xml.sax.SAXException


redefinedElement

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

Parameters:
name - the name of the element


redefinedElement

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

Parameters:
name - the name of the element


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()
            throws org.xml.sax.SAXException


startElement

public void startElement(String name,
                         AttributeList atts)
            throws org.xml.sax.SAXException


toInt

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

Parameters:
str - the String to convert to an int

Returns:
the int derived from the given String


warning

public void warning(SAXParseException exception)
            throws org.xml.sax.SAXException


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