Class SimpleElementHandler

  • All Implemented Interfaces:
    Serializable

    public class SimpleElementHandler
    extends XMLElementHandler
    This class is intended to handle parsing an xml element from an instance document for elements who's type is both known and simple. This handler is used within the XMLSAXHandler to handle sax events generated by the SAX parser.
    Author:
    dzwiers www.refractions.net
    See Also:
    SimpleType, XMLElementHandler, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleElementHandler​(Element st)
      Creates a new SimpleElementHandler object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void characters​(String text1)
      This method throws a SAXNotSupportedException if it is called and not overwritten.
      void endElement​(URI namespaceURI, String localName, Map<String,​Object> hints)
      handles SAX end Element events.
      Element getElement()
      This returns the Element specified.
      XMLElementHandler getHandler​(URI namespaceURI, String localName, Map<String,​Object> hints)
      This will find an appropriate XMLElementHandler for the specified child if appropriate.
      String getName()
      This returns the name of the element being represented by this handler.
      Object getValue()
      This method will get the value of the element depending on it's type.
      void startElement​(URI namespaceURI, String localName, Attributes attr1)
      handles SAX start Element events.
      • Methods inherited from class Object

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

      • SimpleElementHandler

        public SimpleElementHandler​(Element st)
        Creates a new SimpleElementHandler object.
        Parameters:
        st - Element the simple element which we will parse
    • Method Detail

      • getHandler

        public XMLElementHandler getHandler​(URI namespaceURI,
                                            String localName,
                                            Map<String,​Object> hints)
                                     throws SAXException
        Description copied from class: XMLElementHandler
        This will find an appropriate XMLElementHandler for the specified child if appropriate. This method may return or throw an exception, depending on the severity, if an error occurs. This method should be used to complete a SAX parse of a document for which the Schema is known, and parsed.
        Specified by:
        getHandler in class XMLElementHandler
        Returns:
        XMLElementHandler, or null
        Throws:
        SAXException
        See Also:
        org.geotools.xml.XMLElementHandler#getHandler(java.lang.String, java.lang.String)
      • characters

        public void characters​(String text1)
        Description copied from class: XMLElementHandler
        This method throws a SAXNotSupportedException if it is called and not overwritten. When overridding this method, you should be careful to understand that it may be called more than once per element. Therefore it would be advisable to log the text and handle the text's interpretation at a later time (
        Overrides:
        characters in class XMLElementHandler
        See Also:
        XMLElementHandler.characters(java.lang.String)
      • endElement

        public void endElement​(URI namespaceURI,
                               String localName,
                               Map<String,​Object> hints)
                        throws OperationNotSupportedException,
                               SAXException
        Description copied from class: XMLElementHandler
        handles SAX end Element events. This matches the end of the element declaration in the document ... and responds to the event generated by the SAX parser. This is an opportunity to complete some post-processing.
        Specified by:
        endElement in class XMLElementHandler
        Throws:
        OperationNotSupportedException
        SAXException
        See Also:
        org.geotools.xml.XMLElementHandler#endElement(java.lang.String, java.lang.String)
      • startElement

        public void startElement​(URI namespaceURI,
                                 String localName,
                                 Attributes attr1)
        Description copied from class: XMLElementHandler
        handles SAX start Element events. This matches the start of the element declaration in the document ... and responds to the event generated by the SAX parser. This is an opportunity to complete some pre-processing.
        Specified by:
        startElement in class XMLElementHandler
        See Also:
        org.geotools.xml.XMLElementHandler#startElement(java.lang.String, java.lang.String, org.xml.sax.Attributes)