Package org.apache.axiom.om.impl.builder
Class SAXOMBuilder
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.axiom.om.impl.builder.SAXOMBuilder
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,LexicalHandler
public class SAXOMBuilder extends DefaultHandler implements LexicalHandler
-
-
Constructor Summary
Constructors Constructor Description SAXOMBuilder()SAXOMBuilder(OMFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacterData(char[] ch, int start, int length, int nodeType)voidcharacters(char[] ch, int start, int length)voidcomment(char[] ch, int start, int length)protected OMElementcreateNextElement(String localName)voidendCDATA()voidendDocument()voidendDTD()voidendElement(String arg0, String arg1, String arg2)voidendEntity(String name)voidendPrefixMapping(String arg0)OMDocumentgetDocument()OMElementgetRootElement()Get the root element of the Axiom tree built by this content handler.voidignorableWhitespace(char[] ch, int start, int length)voidprocessingInstruction(String target, String data)voidsetDocumentLocator(Locator arg0)voidskippedEntity(String arg0)voidstartCDATA()voidstartDocument()voidstartDTD(String name, String publicId, String systemId)voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)voidstartEntity(String name)voidstartPrefixMapping(String prefix, String uri)-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
SAXOMBuilder
public SAXOMBuilder(OMFactory factory)
-
SAXOMBuilder
public SAXOMBuilder()
-
-
Method Detail
-
setDocumentLocator
public void setDocumentLocator(Locator arg0)
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classDefaultHandler
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
createNextElement
protected OMElement createNextElement(String localName) throws OMException
- Throws:
OMException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String arg0) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
public void endElement(String arg0, String arg1, String arg2) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
characterData
public void characterData(char[] ch, int start, int length, int nodeType) throws SAXException- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classDefaultHandler- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
skippedEntity
public void skippedEntity(String arg0) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classDefaultHandler- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
getDocument
public OMDocument getDocument()
-
getRootElement
public OMElement getRootElement()
Get the root element of the Axiom tree built by this content handler.- Returns:
- the root element of the tree
- Throws:
OMException- if the tree is not complete
-
-