Package org.apache.ws.commons.serialize
Class DOMBuilder
- java.lang.Object
-
- org.apache.ws.commons.serialize.DOMBuilder
-
- All Implemented Interfaces:
ContentHandler
public class DOMBuilder extends Object implements ContentHandler
Converts a stream of SAX events into a DOM node.
-
-
Constructor Summary
Constructors Constructor Description DOMBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endDocument()
void
endElement(String namespaceURI, String localName, String qName)
void
endPrefixMapping(String prefix)
Document
getDocument()
Returns the document being used as object factory.Locator
getDocumentLocator()
Returns the Locator.Node
getTarget()
Returns the target node.void
ignorableWhitespace(char[] ch, int start, int length)
boolean
isPrefixMappingIsAttribute()
Sets whether the eventstartPrefixMapping(java.lang.String, java.lang.String)
shall create anxmlns
attribute.void
processingInstruction(String pTarget, String pData)
void
setDocument(Document pDocument)
Sets the document being used as object factory.void
setDocumentLocator(Locator pLocator)
Sets the Locator.void
setPrefixMappingIsAttribute(boolean pPrefixMappingIsAttribute)
Returns whether the eventstartPrefixMapping(java.lang.String, java.lang.String)
shall create anxmlns
attribute.void
setTarget(Node pNode)
Sets the target node.void
skippedEntity(String pName)
void
startDocument()
void
startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr)
void
startPrefixMapping(String prefix, String uri)
-
-
-
Method Detail
-
isPrefixMappingIsAttribute
public boolean isPrefixMappingIsAttribute()
Sets whether the eventstartPrefixMapping(java.lang.String, java.lang.String)
shall create anxmlns
attribute. Defaults to false.- Returns:
- True, if
xmlns
attributes are being created, false otherwise.
-
setPrefixMappingIsAttribute
public void setPrefixMappingIsAttribute(boolean pPrefixMappingIsAttribute)
Returns whether the eventstartPrefixMapping(java.lang.String, java.lang.String)
shall create anxmlns
attribute. Defaults to false.- Parameters:
pPrefixMappingIsAttribute
- True, ifxmlns
attributes are being created, false otherwise.
-
setDocument
public void setDocument(Document pDocument)
Sets the document being used as object factory.- Parameters:
pDocument
- The object factory.
-
getDocument
public Document getDocument()
Returns the document being used as object factory.- Returns:
- pDocument The object factory.
-
setDocumentLocator
public void setDocumentLocator(Locator pLocator)
Sets the Locator.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Parameters:
pLocator
- The Locator being set.
-
getDocumentLocator
public Locator getDocumentLocator()
Returns the Locator.- Returns:
- The documents Locator.
-
setTarget
public void setTarget(Node pNode)
Sets the target node. The document is built as a fragment in the target node.- Parameters:
pNode
- The target node.
-
getTarget
public Node getTarget()
Returns the target node. The document is built as a fragment in the target node.- Returns:
- The target node.
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String pTarget, String pData) throws SAXException
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
public void skippedEntity(String pName) throws SAXException
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
-