|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.om.impl.builder.SAXOMXMLParserWrapper
public class SAXOMXMLParserWrapper
OMXMLParserWrapper implementation for SAX parsers. By "SAX parser" we mean anything that
is able to write a sequence of events to a SAX ContentHandler.
Note: This is a very naive implementation. Other implementations of the Axiom API may
provide smarter implementations. For example, in theory it should be possible to defer the
invocation of the parser until the OMElement object returned by
getDocumentElement() is accessed.
| Constructor Summary | |
|---|---|
SAXOMXMLParserWrapper(OMFactory factory,
javax.xml.transform.sax.SAXSource source)
|
|
| Method Summary | |
|---|---|
void |
close()
Close this builder. |
void |
discard(OMElement el)
Discards the current element. |
short |
getBuilderType()
Returns the type of the builder. |
java.lang.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. |
java.lang.Object |
getParser()
Allows to access the underlying parser. |
java.lang.Object |
getRegisteredContentHandler()
get the registered external content handler |
boolean |
isCache()
|
boolean |
isCompleted()
|
int |
next()
Proceed the parser one step and return the event value. |
void |
registerExternalContentHandler(java.lang.Object obj)
Registers an external content handler. |
void |
setCache(boolean b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SAXOMXMLParserWrapper(OMFactory factory,
javax.xml.transform.sax.SAXSource source)
| Method Detail |
|---|
public OMDocument getDocument()
OMXMLParserWrapper
getDocument in interface OMXMLParserWrapperOMDocument instancepublic OMElement getDocumentElement()
OMXMLParserWrapperOMDocument.getOMDocumentElement() on the document returned by
OMXMLParserWrapper.getDocument().
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 discarded
public void close()
OMXMLParserWrapper
close in interface OMXMLParserWrapper
public void discard(OMElement el)
throws OMException
OMXMLParserWrapper
discard in interface OMXMLParserWrapperOMExceptionpublic short getBuilderType()
OMXMLParserWrapperOMConstants.PUSH_TYPE_BUILDER
or OMConstants.PULL_TYPE_BUILDER.
getBuilderType in interface OMXMLParserWrapperpublic java.lang.String getCharacterEncoding()
OMXMLParserWrapper
getCharacterEncoding in interface OMXMLParserWrapperpublic java.lang.Object getParser()
OMXMLParserWrapper
getParser in interface OMXMLParserWrapperpublic java.lang.Object getRegisteredContentHandler()
OMXMLParserWrapper
getRegisteredContentHandler in interface OMXMLParserWrapperpublic boolean isCache()
isCache in interface OMXMLParserWrapperpublic boolean isCompleted()
isCompleted in interface OMXMLParserWrapper
public int next()
throws OMException
OMXMLParserWrapper
next in interface OMXMLParserWrapperOMExceptionpublic void registerExternalContentHandler(java.lang.Object obj)
OMXMLParserWrapper
registerExternalContentHandler in interface OMXMLParserWrapper
public void setCache(boolean b)
throws OMException
setCache in interface OMXMLParserWrapperOMException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||