public class SAXOMBuilder extends DefaultHandler implements LexicalHandler, DeclHandler, OMXMLParserWrapper
| Constructor and Description |
|---|
SAXOMBuilder()
Deprecated.
Instead of creating an instance of this class directly, create a
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(SAXSource, boolean). |
SAXOMBuilder(OMFactory factory)
Deprecated.
Instead of creating an instance of this class directly, create a
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(OMFactory, SAXSource, boolean). |
SAXOMBuilder(OMFactory factory,
SAXSource source,
boolean expandEntityReferences)
For internal use only.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attributeDecl(String eName,
String aName,
String type,
String mode,
String value) |
void |
characterData(char[] ch,
int start,
int length,
int nodeType) |
void |
characters(char[] ch,
int start,
int length) |
void |
close()
Close this builder.
|
void |
comment(char[] ch,
int start,
int length) |
protected OMElement |
createNextElement(String localName) |
void |
discard(OMElement el) |
void |
elementDecl(String name,
String model) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String uri,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
externalEntityDecl(String name,
String publicId,
String systemId) |
short |
getBuilderType()
Returns the type of the builder.
|
String |
getCharacterEncoding()
Returns the encoding style of the XML data
|
OMDocument |
getDocument()
Get the document being built by this builder.
|
OMElement |
getDocumentElement()
Get the document element, i.e.
|
OMElement |
getDocumentElement(boolean discardDocument)
Get the document element, optionally discarding the document.
|
Object |
getParser()
Allows to access the underlying parser.
|
Object |
getRegisteredContentHandler()
get the registered external content handler
|
OMElement |
getRootElement()
Get the root element of the Axiom tree built by this content handler.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
internalEntityDecl(String name,
String value) |
boolean |
isCache() |
boolean |
isCompleted() |
int |
next()
Proceed the parser one step and return the event value.
|
void |
notationDecl(String name,
String publicId,
String systemId) |
void |
processingInstruction(String target,
String data) |
void |
registerExternalContentHandler(Object obj)
Registers an external content handler.
|
void |
setCache(boolean b) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName) |
error, fatalError, resolveEntity, warningpublic SAXOMBuilder(OMFactory factory, SAXSource source, boolean expandEntityReferences)
factory - source - expandEntityReferences - public SAXOMBuilder(OMFactory factory)
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(OMFactory, SAXSource, boolean).public SAXOMBuilder()
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(SAXSource, boolean).public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void elementDecl(String name, String model) throws SAXException
elementDecl in interface DeclHandlerSAXExceptionpublic void attributeDecl(String eName, String aName, String type, String mode, String value) throws SAXException
attributeDecl in interface DeclHandlerSAXExceptionpublic void externalEntityDecl(String name, String publicId, String systemId) throws SAXException
externalEntityDecl in interface DeclHandlerSAXExceptionpublic void internalEntityDecl(String name, String value) throws SAXException
internalEntityDecl in interface DeclHandlerSAXExceptionpublic void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl in interface DTDHandlernotationDecl in class DefaultHandlerSAXExceptionpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl in interface DTDHandlerunparsedEntityDecl in class DefaultHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionprotected OMElement createNextElement(String localName) throws OMException
OMExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerSAXExceptionpublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void characterData(char[] ch,
int start,
int length,
int nodeType)
throws SAXException
SAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerSAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic OMDocument getDocument()
OMXMLParserWrappergetDocument in interface OMXMLParserWrapperOMDocument instancepublic OMElement getRootElement()
OMException - if the tree is not completepublic int next()
throws OMException
OMXMLParserWrappernext in interface OMXMLParserWrapperOMExceptionpublic void discard(OMElement el) throws OMException
discard in interface OMXMLParserWrapperOMExceptionpublic void setCache(boolean b)
throws OMException
setCache in interface OMXMLParserWrapperOMExceptionpublic boolean isCache()
isCache in interface OMXMLParserWrapperpublic Object getParser()
OMXMLParserWrappergetParser in interface OMXMLParserWrapperpublic boolean isCompleted()
isCompleted in interface OMXMLParserWrapperpublic OMElement getDocumentElement()
OMXMLParserWrapperOMDocument.getOMDocumentElement() on the document returned by
OMXMLParserWrapper.getDocument().
Note that this method will never return null (except in the very special case
where the document has been requested before and the document element has been removed
explicitly): if the document being parsed has no document element, then this will result in a
parser error, i.e. an OMException will be thrown.
getDocumentElement in interface OMXMLParserWrapperpublic OMElement getDocumentElement(boolean discardDocument)
OMXMLParserWrapperOMXMLParserWrapper.getDocumentElement(). However, if the discardDocument
parameter is set to true, then the document element is removed from the document
and the document itself is discarded. In contrast to using OMNode.detach() this
will not build the element. The implementation also ensures that the element is not built
when it is added to another OM tree. This makes it possible to add the content of a document
to an existing OM tree while preserving the deferred parsing feature. It is even possible to
create an OM tree where different subtrees are associated with different builder instances.getDocumentElement in interface OMXMLParserWrapperdiscardDocument - specifies whether the document should be discardedpublic short getBuilderType()
OMXMLParserWrapperOMConstants.PUSH_TYPE_BUILDER
or OMConstants.PULL_TYPE_BUILDER.getBuilderType in interface OMXMLParserWrapperpublic void registerExternalContentHandler(Object obj)
OMXMLParserWrapperregisterExternalContentHandler in interface OMXMLParserWrapperpublic Object getRegisteredContentHandler()
OMXMLParserWrappergetRegisteredContentHandler in interface OMXMLParserWrapperpublic String getCharacterEncoding()
OMXMLParserWrappergetCharacterEncoding in interface OMXMLParserWrapperpublic void close()
OMXMLParserWrapperclose in interface OMXMLParserWrapperCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.