org.geotools.xml.impl
Class DelegatingHandler

java.lang.Object
  extended by org.geotools.xml.impl.DelegatingHandler
All Implemented Interfaces:
DocumentHandler, ElementHandler, Handler

public class DelegatingHandler
extends java.lang.Object
implements DocumentHandler, ElementHandler


Method Summary
 void characters(char[] ch, int start, int length)
          Callback when characters of an element are encountered.
 Handler createChildHandler(javax.xml.namespace.QName name)
          Returns a handler for a component in the schema which is a child of this component.
 void endChildHandler(Handler child)
          Called when a child handler is finished, on the trailing edge of the child element.
 void endDocument()
           
 void endElement(javax.xml.namespace.QName name)
          Callback on trailing edge of element.
 InstanceComponent getComponent()
           
 org.picocontainer.MutablePicoContainer getContext()
           
 org.eclipse.xsd.XSDElementDeclaration getElementDeclaration()
           
 Handler getParentHandler()
           
 Node getParseNode()
           
 org.eclipse.xsd.XSDSchemaContent getSchemaContent()
           
 void setContext(org.picocontainer.MutablePicoContainer context)
           
 void startChildHandler(Handler child)
          Called when a child handler is started, on the leading edge of the child element.
 void startDocument()
          Returns the element handler for the root element of an instance document.
 void startElement(javax.xml.namespace.QName name, org.xml.sax.Attributes attributes)
          Callback on leading edge of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setContext

public void setContext(org.picocontainer.MutablePicoContainer context)
Specified by:
setContext in interface Handler
Parameters:
context - The context in which the the instance is to be parsed in.

getContext

public org.picocontainer.MutablePicoContainer getContext()
Specified by:
getContext in interface Handler
Returns:
The context or container in which the instance is to be parsed in.

getElementDeclaration

public org.eclipse.xsd.XSDElementDeclaration getElementDeclaration()
Specified by:
getElementDeclaration in interface ElementHandler
Returns:
The declaration of hte element being handled.

getParentHandler

public Handler getParentHandler()
Specified by:
getParentHandler in interface Handler
Returns:
The parent handler.
See Also:
Handler#getChildHandler(QName, SchemaBuilder)

createChildHandler

public Handler createChildHandler(javax.xml.namespace.QName name)
Description copied from interface: Handler
Returns a handler for a component in the schema which is a child of this component.

This method will return null in two situations:

  1. The schema component being handled does not support children (for example, an attribute).
  2. A child with the specified qName could not be found.

Specified by:
createChildHandler in interface Handler
Parameters:
name - The qualified name of the schema component.
Returns:
A new handler, or null if one cannot be created.

startChildHandler

public void startChildHandler(Handler child)
Description copied from interface: Handler
Called when a child handler is started, on the leading edge of the child element.

Specified by:
startChildHandler in interface Handler
Parameters:
child - The executing child handler.

endChildHandler

public void endChildHandler(Handler child)
Description copied from interface: Handler
Called when a child handler is finished, on the trailing edge of the child element.

Specified by:
endChildHandler in interface Handler
Parameters:
child - The executing child handler.

getComponent

public InstanceComponent getComponent()
Specified by:
getComponent in interface Handler
Returns:
The instance of the schema content that is currently being handled.

getParseNode

public Node getParseNode()
Specified by:
getParseNode in interface Handler
Returns:
The parse tree for the handler.

getSchemaContent

public org.eclipse.xsd.XSDSchemaContent getSchemaContent()
Specified by:
getSchemaContent in interface Handler
Returns:
The entity of the schema that corresponds to the handler.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Description copied from interface: DocumentHandler
Returns the element handler for the root element of an instance document.

Specified by:
startDocument in interface DocumentHandler
Throws:
org.xml.sax.SAXException

endDocument

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

startElement

public void startElement(javax.xml.namespace.QName name,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Description copied from interface: ElementHandler
Callback on leading edge of an element.

Specified by:
startElement in interface ElementHandler
Parameters:
name - The qualified name of the element being handled.
attributes - The attributes of hte elmenent being handled.
Throws:
org.xml.sax.SAXException - Any xml errors that occur.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from interface: ElementHandler
Callback when characters of an element are encountered.

Specified by:
characters in interface ElementHandler
Parameters:
ch - Array containing characters.
start - The starting index of the characters.
length - The number of characters.
Throws:
org.xml.sax.SAXException - Any xml errors.
See Also:
ContentHandler.characters(char[], int, int)

endElement

public void endElement(javax.xml.namespace.QName name)
                throws org.xml.sax.SAXException
Description copied from interface: ElementHandler
Callback on trailing edge of element.

Specified by:
endElement in interface ElementHandler
Parameters:
name - The qualified name of the element being handled.
Throws:
org.xml.sax.SAXException - Any xml errors.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)


Copyright © 1996-2010 Geotools. All Rights Reserved.