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 voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(String namespaceURI, String localName, String qName)voidendPrefixMapping(String prefix)DocumentgetDocument()Returns the document being used as object factory.LocatorgetDocumentLocator()Returns the Locator.NodegetTarget()Returns the target node.voidignorableWhitespace(char[] ch, int start, int length)booleanisPrefixMappingIsAttribute()Sets whether the eventstartPrefixMapping(java.lang.String, java.lang.String)shall create anxmlnsattribute.voidprocessingInstruction(String pTarget, String pData)voidsetDocument(Document pDocument)Sets the document being used as object factory.voidsetDocumentLocator(Locator pLocator)Sets the Locator.voidsetPrefixMappingIsAttribute(boolean pPrefixMappingIsAttribute)Returns whether the eventstartPrefixMapping(java.lang.String, java.lang.String)shall create anxmlnsattribute.voidsetTarget(Node pNode)Sets the target node.voidskippedEntity(String pName)voidstartDocument()voidstartElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr)voidstartPrefixMapping(String prefix, String uri)
-
-
-
Method Detail
-
isPrefixMappingIsAttribute
public boolean isPrefixMappingIsAttribute()
Sets whether the eventstartPrefixMapping(java.lang.String, java.lang.String)shall create anxmlnsattribute. Defaults to false.- Returns:
- True, if
xmlnsattributes are being created, false otherwise.
-
setPrefixMappingIsAttribute
public void setPrefixMappingIsAttribute(boolean pPrefixMappingIsAttribute)
Returns whether the eventstartPrefixMapping(java.lang.String, java.lang.String)shall create anxmlnsattribute. Defaults to false.- Parameters:
pPrefixMappingIsAttribute- True, ifxmlnsattributes 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:
setDocumentLocatorin 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:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String pTarget, String pData) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
public void skippedEntity(String pName) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
-