Class 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.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 
      Modifier and Type Field Description
      protected org.xml.sax.Locator _locator
      The 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
      void characters​(char[] ch, int start, int length)  
      abstract java.lang.String elementName()
      Returns the name of the element that this SaxUnmarshaller handles
      void endDocument()  
      void endElement​(java.lang.String name)  
      void error​(java.lang.String err)
      This method is called for a general error.
      void error​(org.xml.sax.SAXParseException exception)  
      void fatalError​(org.xml.sax.SAXParseException exception)  
      void finish()
      Called to signal an end of unmarshalling.
      org.xml.sax.Locator getDocumentLocator()  
      abstract java.lang.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​(java.lang.String attName)
      This method is called when an illegal Attribute is encountered.
      void illegalElement​(java.lang.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​(java.lang.String name)
      This method is called when an out of order element is encountered
      void processingInstruction​(java.lang.String target, java.lang.String data)  
      void redefinedElement​(java.lang.String name)
      This method is called when an element which may only be defined once, is redefined.
      void redefinedElement​(java.lang.String name, java.lang.String xtraInfo)
      This method is called when an element which may only be defined once, is redefined.
      void setDocumentLocator​(org.xml.sax.Locator locator)  
      void setResolver​(Resolver resolver)
      Sets the Resolver to be used for resolving id references
      void startDocument()  
      void startElement​(java.lang.String name, org.xml.sax.AttributeList atts)  
      static int toInt​(java.lang.String str)
      Converts the given String to an int
      void warning​(org.xml.sax.SAXParseException exception)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _locator

        protected org.xml.sax.Locator _locator
        The document locator
    • Constructor Detail

      • SaxUnmarshaller

        public SaxUnmarshaller()
    • 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.SAXException
        Called 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 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​(java.lang.String err)
                   throws org.xml.sax.SAXException
        This 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.SAXException
        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​(java.lang.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
        Throws:
        org.xml.sax.SAXException - always thrown.
      • redefinedElement

        public void redefinedElement​(java.lang.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
        Throws:
        org.xml.sax.SAXException - always thrown.
      • redefinedElement

        public void redefinedElement​(java.lang.String name,
                                     java.lang.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
        Throws:
        org.xml.sax.SAXException - always thrown.
      • outOfOrder

        public void outOfOrder​(java.lang.String name)
                        throws org.xml.sax.SAXException
        This 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.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:
        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:
        characters in interface org.xml.sax.DocumentHandler
        Throws:
        org.xml.sax.SAXException
      • endDocument

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

        public void endElement​(java.lang.String name)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.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:
        ignorableWhitespace in interface org.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:
        processingInstruction in interface org.xml.sax.DocumentHandler
        Throws:
        org.xml.sax.SAXException
      • setDocumentLocator

        public void setDocumentLocator​(org.xml.sax.Locator locator)
        Specified by:
        setDocumentLocator in interface org.xml.sax.DocumentHandler
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.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:
        startElement in interface org.xml.sax.DocumentHandler
        Throws:
        org.xml.sax.SAXException
      • error

        public void error​(org.xml.sax.SAXParseException exception)
                   throws org.xml.sax.SAXException
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException exception)
                        throws org.xml.sax.SAXException
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException
      • warning

        public void warning​(org.xml.sax.SAXParseException exception)
                     throws org.xml.sax.SAXException
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException