public final class DomBuilderFromSax extends DefaultHandler
Document
from an XML Schema during a SAX
walk.Constructor and Description |
---|
DomBuilderFromSax(org.apache.ws.commons.schema.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
QName s to XmlSchemaStateMachineNode s. |
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, warning
public DomBuilderFromSax(org.apache.ws.commons.schema.XmlSchemaCollection xmlSchemaCollection) throws ParserConfigurationException
DocumentBuilderFromSax
.ParserConfigurationException
- If unable to create a
DocumentBuilder
.public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
DefaultHandler.startDocument()
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
SAXException
DefaultHandler.startPrefixMapping(String,
String)
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
SAXException
DefaultHandler.endPrefixMapping(String)
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
DefaultHandler.startElement(String, String, String, Attributes)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
DefaultHandler.characters(char[], int, int)
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
DefaultHandler.endElement(String, String, String)
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
DefaultHandler.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)
QName
s to XmlSchemaStateMachineNode
s.
This is used to disambiguate:
statesByQName
- The state-machine-node-by-QName mapping.Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.