Class SaxUnmarshaller
- java.lang.Object
-
- org.exolab.castor.xml.schema.reader.SaxUnmarshaller
-
- All Implemented Interfaces:
org.xml.sax.DocumentHandler,org.xml.sax.ErrorHandler
public abstract class SaxUnmarshaller extends java.lang.Object implements org.xml.sax.DocumentHandler, org.xml.sax.ErrorHandlerThe base class for unmarshallers- Version:
- $Revision: 5951 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco
-
-
Field Summary
Fields Modifier and Type Field Description protected org.xml.sax.Locator_locatorThe document locator
-
Constructor Summary
Constructors Constructor Description SaxUnmarshaller()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)abstract java.lang.StringelementName()Returns the name of the element that this SaxUnmarshaller handlesvoidendDocument()voidendElement(java.lang.String name)voiderror(java.lang.String err)This method is called for a general error.voiderror(org.xml.sax.SAXParseException exception)voidfatalError(org.xml.sax.SAXParseException exception)voidfinish()Called to signal an end of unmarshalling.org.xml.sax.LocatorgetDocumentLocator()abstract java.lang.ObjectgetObject()Returns the Object created by this UnmarshallerResolvergetResolver()Returns the resolver used for resolving id references.voidignorableWhitespace(char[] ch, int start, int length)voidillegalAttribute(java.lang.String attName)This method is called when an illegal Attribute is encountered.voidillegalElement(java.lang.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 charactersvoidoutOfOrder(java.lang.String name)This method is called when an out of order element is encounteredvoidprocessingInstruction(java.lang.String target, java.lang.String data)voidredefinedElement(java.lang.String name)This method is called when an element which may only be defined once, is redefined.voidredefinedElement(java.lang.String name, java.lang.String xtraInfo)This method is called when an element which may only be defined once, is redefined.voidsetDocumentLocator(org.xml.sax.Locator locator)voidsetResolver(Resolver resolver)Sets the Resolver to be used for resolving id referencesvoidstartDocument()voidstartElement(java.lang.String name, org.xml.sax.AttributeList atts)static inttoInt(java.lang.String str)Converts the given String to an intvoidwarning(org.xml.sax.SAXParseException exception)
-
-
-
Method Detail
-
elementName
public abstract java.lang.String elementName()
Returns the name of the element that this SaxUnmarshaller handles- Returns:
- the name of the element that this SaxUnmarshaller handles
-
getObject
public abstract java.lang.Object getObject()
Returns the Object created by this Unmarshaller- Returns:
- the Object created by this Unmarshaller
-
finish
public void finish() throws org.xml.sax.SAXExceptionCalled to signal an end of unmarshalling. This method should be overridden to perform any necessary clean up by an unmarshaller- Throws:
org.xml.sax.SAXException
-
getDocumentLocator
public org.xml.sax.Locator getDocumentLocator()
-
getResolver
public Resolver getResolver()
Returns the resolver used for resolving id references.- Returns:
- the resolver used for resolving id references.
-
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
-
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 whitespacestart- the start index into the character arraylength- the number of characters to check- Returns:
- true if the characters specficied consist only of whitespace characters
-
error
public void error(java.lang.String err) throws org.xml.sax.SAXExceptionThis method is called for a general error.- Parameters:
err- the error message to report- Throws:
org.xml.sax.SAXException- always thrown.
-
illegalAttribute
public void illegalAttribute(java.lang.String attName) throws org.xml.sax.SAXExceptionThis 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(java.lang.String name) throws org.xml.sax.SAXExceptionThis method is called when an illegal Element is encountered.- Parameters:
name- the name of the illegal element- Throws:
org.xml.sax.SAXException- always thrown.
-
redefinedElement
public void redefinedElement(java.lang.String name) throws org.xml.sax.SAXExceptionThis 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(java.lang.String name, java.lang.String xtraInfo) throws org.xml.sax.SAXExceptionThis 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.
-
outOfOrder
public void outOfOrder(java.lang.String name) throws org.xml.sax.SAXExceptionThis method is called when an out of order element is encountered- Throws:
org.xml.sax.SAXException- always thrown.
-
toInt
public static int toInt(java.lang.String str) throws java.lang.IllegalArgumentExceptionConverts the given String to an int- Parameters:
str- the String to convert to an int- Returns:
- the int derived from the given String
- Throws:
java.lang.IllegalArgumentException- when the given String does not represent a valid int
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException- Specified by:
charactersin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException- Specified by:
endDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String name) throws org.xml.sax.SAXException- Specified by:
endElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException- Specified by:
processingInstructionin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.DocumentHandler
-
startDocument
public void startDocument() throws org.xml.sax.SAXException- Specified by:
startDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXException- Specified by:
startElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
error
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
warning
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
warningin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
-