org.geotools.xml
Class XSIElementHandler

java.lang.Object
  extended byorg.geotools.xml.XSIElementHandler
All Implemented Interfaces:
java.io.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 java.lang.Object
implements java.io.Serializable

XSIElementHandler purpose.

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.

Version:
$Id: XSIElementHandler.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
dzwiers, Refractions Research, Inc. http://www.refractions.net, $Author:$ (last modification)
See Also:
Serialized Form

Field Summary
static int DEFAULT
          Type constants
static int EXTENSION
          Type constants
static int FACET
          Type constants
static int LIST
          Type constants
static java.util.logging.Logger logger
          the logger -- should be used for debugging (assuming there are bugs LOL)
static int RESTRICTION
          Type constants
static int SEQUENCE
          Type constants
static int SIMPLETYPE
          Type constants
static int UNION
          Type constants
 
Constructor Summary
protected XSIElementHandler()
          Creates a new XSIElementHandler object.
 
Method Summary
 void characters(java.lang.String text)
          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(java.lang.String namespaceURI, java.lang.String localName)
          handles SAX end Element events. this is an opportunity to complete some post-processing
 boolean equals(java.lang.Object obj)
           
abstract  XSIElementHandler getHandler(java.lang.String namespaceURI, java.lang.String localName)
          This method will be used to create the XSI document.
abstract  int getHandlerType()
          Returns one of the Specified types ... intended for use by the child packages only
abstract  java.lang.String getLocalName()
          Returns the LocalName for this element (ie this declaration in the Schema ... so ComplexType or Sequence ...)
abstract  int hashCode()
           
static void setLogLevel(java.util.logging.Level l)
           Sets the logging level for all XSIElementHandlers
abstract  void startElement(java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attr)
          handles SAX start Element events.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger
the logger -- should be used for debugging (assuming there are bugs LOL)


DEFAULT

public static final int DEFAULT
Type constants

See Also:
Constant Field Values

UNION

public static final int UNION
Type constants

See Also:
Constant Field Values

LIST

public static final int LIST
Type constants

See Also:
Constant Field Values

RESTRICTION

public static final int RESTRICTION
Type constants

See Also:
Constant Field Values

EXTENSION

public static final int EXTENSION
Type constants

See Also:
Constant Field Values

SIMPLETYPE

public static final int SIMPLETYPE
Type constants

See Also:
Constant Field Values

SEQUENCE

public static final int SEQUENCE
Type constants

See Also:
Constant Field Values

FACET

public static final int FACET
Type constants

See Also:
Constant Field Values
Constructor Detail

XSIElementHandler

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

Method Detail

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(java.lang.String text)
                throws org.xml.sax.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.

Parameters:
text -
Throws:
org.xml.sax.SAXException
org.xml.sax.SAXNotSupportedException

endElement

public abstract void endElement(java.lang.String namespaceURI,
                                java.lang.String localName)
                         throws org.xml.sax.SAXException
handles SAX end Element events. this is an opportunity to complete some post-processing

Parameters:
namespaceURI -
localName -
Throws:
org.xml.sax.SAXException

startElement

public abstract void startElement(java.lang.String namespaceURI,
                                  java.lang.String localName,
                                  org.xml.sax.Attributes attr)
                           throws org.xml.sax.SAXException
handles SAX start Element events. This is an opportunity to complete some pre-processing.

Parameters:
namespaceURI -
localName -
attr -
Throws:
org.xml.sax.SAXException

getHandler

public abstract XSIElementHandler getHandler(java.lang.String namespaceURI,
                                             java.lang.String localName)
                                      throws org.xml.sax.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.

Parameters:
namespaceURI -
localName -
Returns:
XSIElementHandler, or null
Throws:
org.xml.sax.SAXException

getLocalName

public abstract java.lang.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(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

hashCode

public abstract int hashCode()
See Also:
Object.hashCode()

setLogLevel

public static void setLogLevel(java.util.logging.Level l)

Sets the logging level for all XSIElementHandlers

Parameters:
l -


Copyright © GeoTools. All Rights Reserved.