public final class DomBuilderFromSax extends DefaultHandler
Document from an XML Schema during a SAX
walk.| Constructor and Description |
|---|
DomBuilderFromSax(XmlSchemaCollection xmlSchemaCollection)
Creates a new
DocumentBuilderFromSax. |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Adds content to the current element.
|
void |
endDocument() |
void |
endElement(String uri,
String localName,
String qName)
Closes the current element in the generated XML document.
|
void |
endPrefixMapping(String prefix) |
Document |
getDocument()
Retrieves the document constructed from the SAX walk.
|
Map<String,String> |
getNamespaceToLocationMapping()
Retrieves the XML Schema namespace -> location mapping set by the last
call to
setNamespaceToLocationMapping(Map). |
Map<QName,XmlSchemaStateMachineNode> |
getStateMachinesByQName()
Retrieves the
QName -> XmlSchemaStateMachineNode mapping
defined by the call to setStateMachinesByQName(Map). |
void |
setNamespaceToLocationMapping(Map<String,String> nsToLocMapping)
Sets the XML Schema namespace -> location mapping to use when defining
the schemaLocation attribute in the generated XML document.
|
void |
setStateMachinesByQName(Map<QName,XmlSchemaStateMachineNode> statesByQName)
Sets the mapping of
QNames to XmlSchemaStateMachineNodes. |
void |
startDocument() |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
Starts a new element in the generated XML document.
|
void |
startPrefixMapping(String prefix,
String uri) |
error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warningpublic DomBuilderFromSax(XmlSchemaCollection xmlSchemaCollection) throws ParserConfigurationException
DocumentBuilderFromSax.ParserConfigurationException - If unable to create a
DocumentBuilder.public void startDocument()
throws SAXException
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
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionDefaultHandler.characters(char[], int, int)public void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionDefaultHandler.endElement(String, String, String)public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionDefaultHandler.endDocument()public Document getDocument()
public Map<String,String> getNamespaceToLocationMapping()
setNamespaceToLocationMapping(Map).public void setNamespaceToLocationMapping(Map<String,String> nsToLocMapping)
nsToLocMapping - The namespace -> location mapping.public Map<QName,XmlSchemaStateMachineNode> getStateMachinesByQName()
QName -> XmlSchemaStateMachineNode mapping
defined by the call to setStateMachinesByQName(Map).public void setStateMachinesByQName(Map<QName,XmlSchemaStateMachineNode> statesByQName)
QNames to XmlSchemaStateMachineNodes.
This is used to disambiguate:
statesByQName - The state-machine-node-by-QName mapping.Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.