org.geotools.xml
Class XSDParserDelegate

java.lang.Object
  extended by org.geotools.xml.XSDParserDelegate
All Implemented Interfaces:
ParserDelegate, org.xml.sax.ContentHandler
Direct Known Subclasses:
GMLParserDelegate, GMLParserDelegate, WFSParserDelegate

public class XSDParserDelegate
extends java.lang.Object
implements ParserDelegate

Parser delegate which which uses the xsd framework to parse.

This is used to support the parsing of dynamically imported schemas, ie schemas that are included on the fly in an instance document but not referenced by the schema itself.

Since:
2.6
Author:
Justin Deoliveira, OpenGEO

Constructor Summary
XSDParserDelegate(Configuration configuration)
           
 
Method Summary
 boolean canHandle(javax.xml.namespace.QName elementName)
          Determines if this delegate can handle the specified element name.
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 void endPrefixMapping(java.lang.String prefix)
           
 java.lang.Object getParsedObject()
          Gets the final parsed object from the delegate.
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String name)
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes atts)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSDParserDelegate

public XSDParserDelegate(Configuration configuration)
Method Detail

canHandle

public boolean canHandle(javax.xml.namespace.QName elementName)
Description copied from interface: ParserDelegate
Determines if this delegate can handle the specified element name.

A common check in this method would be to check the namespace of the element.

Specified by:
canHandle in interface ParserDelegate
Parameters:
elementName - The name of the element to potentially handle.
Returns:
True if this delegate handles elements of the specified name and should take over parsing.

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

startDocument

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

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
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.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endDocument

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

getParsedObject

public java.lang.Object getParsedObject()
Description copied from interface: ParserDelegate
Gets the final parsed object from the delegate.

This method is called after parsing control returns to the main parsing driver.

Specified by:
getParsedObject in interface ParserDelegate


Copyright © 1996-2010 Geotools. All Rights Reserved.