Class SaxUnmarshaller
java.lang.Object
org.exolab.castor.xml.schema.reader.SaxUnmarshaller
- All Implemented Interfaces:
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) abstract StringReturns the name of the element that this SaxUnmarshaller handlesvoidvoidendElement(String name) voidThis method is called for a general error.voiderror(SAXParseException exception) voidfatalError(SAXParseException exception) voidfinish()Called to signal an end of unmarshalling.abstract ObjectReturns the Object created by this UnmarshallerReturns 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 charactersvoidoutOfOrder(String name) This method is called when an out of order element is encounteredvoidprocessingInstruction(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 referencesvoidvoidstartElement(String name, AttributeList atts) static intConverts the given String to an intvoidwarning(SAXParseException exception)
-
Field Details
-
_locator
The document locator
-
-
Constructor Details
-
SaxUnmarshaller
public SaxUnmarshaller()
-
-
Method Details
-
elementName
Returns the name of the element that this SaxUnmarshaller handles- Returns:
- the name of the element that this SaxUnmarshaller handles
-
getObject
Returns the Object created by this Unmarshaller- Returns:
- the Object created by this Unmarshaller
-
finish
Called to signal an end of unmarshalling. This method should be overridden to perform any necessary clean up by an unmarshaller- Throws:
SAXException
-
getDocumentLocator
-
getResolver
Returns the resolver used for resolving id references.- Returns:
- the resolver used for resolving id references.
-
setResolver
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
This method is called for a general error.- Parameters:
err- the error message to report- Throws:
SAXException- always thrown.
-
illegalAttribute
This method is called when an illegal Attribute is encountered.- Parameters:
attName- the name of the illegal attribute.- Throws:
SAXException- always thrown.
-
illegalElement
This method is called when an illegal Element is encountered.- Parameters:
name- the name of the illegal element- Throws:
SAXException- always thrown.
-
redefinedElement
This method is called when an element which may only be defined once, is redefined.- Parameters:
name- the name of the element- Throws:
SAXException- always thrown.
-
redefinedElement
This method is called when an element which may only be defined once, is redefined.- Parameters:
name- the name of the element- Throws:
SAXException- always thrown.
-
outOfOrder
This method is called when an out of order element is encountered- Throws:
SAXException- always thrown.
-
toInt
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
-
characters
- Specified by:
charactersin interfaceDocumentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceDocumentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceDocumentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceDocumentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceDocumentHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceDocumentHandler
-
startDocument
- Specified by:
startDocumentin interfaceDocumentHandler- Throws:
SAXException
-
startElement
- Specified by:
startElementin interfaceDocumentHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-