Class XSIElementHandler

Object
XSIElementHandler
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AnyAttributeHandler, AttributeGroupHandler, AttributeHandler, ComplexContentHandler, ComplexTypeHandler, ElementGroupingHandler, ExtensionHandler, FacetHandler, FieldHandler, IgnoreHandler, ImportHandler, IncludeHandler, KeyHandler, KeyrefHandler, ListHandler, RedefineHandler, RestrictionHandler, RootHandler, SchemaHandler, SelectorHandler, SimpleContentHandler, SimpleTypeHandler, UnionHandler, UniqueHandler

public abstract class XSIElementHandler extends Object implements Serializable
This abstract class is intended to act as both a definition of what a generic handler is, and a default handler.

When extending this class, one should as a minimum replace the start/end Element methods.

Author:
dzwiers, Refractions Research, Inc. http://www.refractions.net, $Author:$ (last modification)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Type constants
    static final int
    Type constants
    static final int
    Type constants
    static final int
    Type constants
    static final Logger
    the logger -- should be used for debugging (assuming there are bugs LOL)
    static final int
    Type constants
    static final int
    Type constants
    static final int
    Type constants
    static final int
    Type constants
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new XSIElementHandler object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    In most cases this class should not be called within this framework as we do not intend to parse + store all the information required to recreate the exact Schema document being parsed.
    abstract void
    endElement(String namespaceURI, String localName)
    handles SAX end Element events. this is an opportunity to complete some post-processing
    boolean
     
    getHandler(String namespaceURI, String localName)
    This method will be used to create the XSI document.
    abstract int
    Returns one of the Specified types ... intended for use by the child packages only
    abstract String
    Returns the LocalName for this element (ie this declaration in the Schema ... so ComplexType or Sequence ...)
    abstract int
     
    static void
    Sets the logging level for all XSIElementHandlers
    abstract void
    startElement(String namespaceURI, String localName, Attributes attr)
    handles SAX start Element events.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • XSIElementHandler

      protected XSIElementHandler()
      Creates a new XSIElementHandler object. Intended to limit creation to the sub-packages
  • Method Details

    • getHandlerType

      public abstract int getHandlerType()
      Returns one of the Specified types ... intended for use by the child packages only
      Returns:
      int (DEFAULT?)
    • characters

      public void characters(String text) throws SAXException
      In most cases this class should not be called within this framework as we do not intend to parse + store all the information required to recreate the exact Schema document being parsed. As a result, information such as annotations are ignored. When used, they method may be called multiple times for one element. This means the implementor should keep this in mind when overriding this method.
      Throws:
      SAXException
    • endElement

      public abstract void endElement(String namespaceURI, String localName) throws SAXException
      handles SAX end Element events. this is an opportunity to complete some post-processing
      Throws:
      SAXException
    • startElement

      public abstract void startElement(String namespaceURI, String localName, Attributes attr) throws SAXException
      handles SAX start Element events. This is an opportunity to complete some pre-processing.
      Throws:
      SAXException
    • getHandler

      public abstract XSIElementHandler getHandler(String namespaceURI, String localName) throws SAXException
      This method will be used to create the XSI document. Validation and in-fix processing is expected to exist within this method, along with data logging for post-processing. This method will directly affect the stack being used to complete the parse.
      Returns:
      XSIElementHandler, or null
      Throws:
      SAXException
    • getLocalName

      public abstract String getLocalName()
      Returns the LocalName for this element (ie this declaration in the Schema ... so ComplexType or Sequence ...)
      Returns:
      String (not-null)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • setLogLevel

      public static void setLogLevel(Level l)
      Sets the logging level for all XSIElementHandlers