Class SaxUnmarshaller

java.lang.Object
org.exolab.castor.xml.schema.reader.SaxUnmarshaller
All Implemented Interfaces:
DocumentHandler, ErrorHandler

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 Details

    • _locator

      protected Locator _locator
      The document locator
  • Constructor Details

    • SaxUnmarshaller

      public SaxUnmarshaller()
  • Method Details

    • 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
    • getObject

      public abstract Object getObject()
      Returns the Object created by this Unmarshaller
      Returns:
      the Object created by this Unmarshaller
    • 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
      Throws:
      SAXException
    • getDocumentLocator

      public 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 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
    • error

      public void error(String err) throws SAXException
      This method is called for a general error.
      Parameters:
      err - the error message to report
      Throws:
      SAXException - always thrown.
    • illegalAttribute

      public void illegalAttribute(String attName) throws SAXException
      This method is called when an illegal Attribute is encountered.
      Parameters:
      attName - the name of the illegal attribute.
      Throws:
      SAXException - always thrown.
    • illegalElement

      public void illegalElement(String name) throws SAXException
      This method is called when an illegal Element is encountered.
      Parameters:
      name - the name of the illegal element
      Throws:
      SAXException - always thrown.
    • redefinedElement

      public void redefinedElement(String name) throws SAXException
      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

      public void redefinedElement(String name, String xtraInfo) throws SAXException
      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

      public void outOfOrder(String name) throws SAXException
      This method is called when an out of order element is encountered
      Throws:
      SAXException - always thrown.
    • 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
      Throws:
      IllegalArgumentException - when the given String does not represent a valid int
    • characters

      public void characters(char[] ch, int start, int length) throws SAXException
      Specified by:
      characters in interface DocumentHandler
      Throws:
      SAXException
    • endDocument

      public void endDocument() throws SAXException
      Specified by:
      endDocument in interface DocumentHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String name) throws SAXException
      Specified by:
      endElement in interface DocumentHandler
      Throws:
      SAXException
    • ignorableWhitespace

      public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
      Specified by:
      ignorableWhitespace in interface DocumentHandler
      Throws:
      SAXException
    • processingInstruction

      public void processingInstruction(String target, String data) throws SAXException
      Specified by:
      processingInstruction in interface DocumentHandler
      Throws:
      SAXException
    • setDocumentLocator

      public void setDocumentLocator(Locator locator)
      Specified by:
      setDocumentLocator in interface DocumentHandler
    • startDocument

      public void startDocument() throws SAXException
      Specified by:
      startDocument in interface DocumentHandler
      Throws:
      SAXException
    • startElement

      public void startElement(String name, AttributeList atts) throws SAXException
      Specified by:
      startElement in interface DocumentHandler
      Throws:
      SAXException
    • error

      public void error(SAXParseException exception) throws SAXException
      Specified by:
      error in interface ErrorHandler
      Throws:
      SAXException
    • fatalError

      public void fatalError(SAXParseException exception) throws SAXException
      Specified by:
      fatalError in interface ErrorHandler
      Throws:
      SAXException
    • warning

      public void warning(SAXParseException exception) throws SAXException
      Specified by:
      warning in interface ErrorHandler
      Throws:
      SAXException