|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.ws.commons.schema.docpath.XmlSchemaPathFinder<U,V>
public final class XmlSchemaPathFinder<U,V>
Performs a SAX-based walk through the XML document, determining the interpretation ("path") that best matches the XML Schema.
This is a traditional DefaultHandler that can be attached to either a
SAXParser during a parse, or to
SaxWalkerOverDom to find paths through an
Document.
Because this is a SAX-based walk, the source information need not be an XML document. It can be any data that can be interpreted via a SAX walk. This can be helpful when trying to confirm the source data can be converted back into XML.
| Constructor Summary | |
|---|---|
XmlSchemaPathFinder(XmlSchemaStateMachineNode root)
Creates a new XmlToAvroPathCreator with the root
XmlSchemaStateMachineNode to start from when evaluating
documents. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Adds a new XmlSchemaPathNode.Direction.CONTENT
XmlSchemaPathNode to the path. |
void |
endDocument()
Called when the XML Document traversal is complete. |
void |
endElement(String uri,
String localName,
String qName)
Ends the current element. |
void |
endPrefixMapping(String prefix)
Handles the end of a prefix mapping in the SAX walk. |
XmlSchemaPathNode<U,V> |
getXmlSchemaTraversal()
Once a traversal completes successfully, this method may be called to retrieve the relevant interpretation of the path through the XmlSchemaStateMachineNodes. |
void |
startDocument()
Kick-starts a new SAX walk, building new XmlSchemaPathNode
and XmlSchemaDocumentNode traversals in the process. |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
Find the path through the XML Schema that best matches this element, traversing any relevant groups, and backtracking if necessary. |
void |
startPrefixMapping(String prefix,
String uri)
Handles a new prefix mapping in the SAX walk. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlSchemaPathFinder(XmlSchemaStateMachineNode root)
XmlToAvroPathCreator with the root
XmlSchemaStateMachineNode to start from when evaluating
documents.
| Method Detail |
|---|
public void startDocument()
throws SAXException
XmlSchemaPathNode
and XmlSchemaDocumentNode traversals in the process.
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXExceptionDefaultHandler.startDocument()
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerSAXExceptionDefaultHandler.startPrefixMapping(String, String)
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerSAXExceptionDefaultHandler.endPrefixMapping(String)
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionDefaultHandler.startElement(String, String, String, Attributes)
public void characters(char[] ch,
int start,
int length)
throws SAXException
XmlSchemaPathNode.Direction.CONTENT
XmlSchemaPathNode to the path. Throws an
IllegalStateException if the owning element should not receive
content, or the content is empty when it should not be.
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionDefaultHandler.characters(char[], int, int)
public void endElement(String uri,
String localName,
String qName)
throws SAXException
uri and localName, throws an
IllegalStateException.
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionDefaultHandler.endElement(String, String, String)
public void endDocument()
throws SAXException
Confirms all open elements have been closed. If not, throws an
IllegalStateException.
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic XmlSchemaPathNode<U,V> getXmlSchemaTraversal()
XmlSchemaStateMachineNodes.
XmlSchemaPathNode.getDocumentNode() can be called to retrieve the
interpretation of the XML Schema as applied to the document; meanwhile
the walk through XmlSchemaPathNodes will show how that schema was
traversed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||