public interface OMXMLParserWrapper
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this builder.
|
void |
detach()
Detach this builder from its underlying source, so that the state of the source object can be
changed without impact on the object model produced by this builder.
|
void |
discard(OMElement el)
Deprecated.
Use
OMNode.discard() to discard elements. |
short |
getBuilderType()
Deprecated.
This method is no longer used.
|
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. the root element of the document.
|
OMElement |
getDocumentElement(boolean discardDocument)
Get the document element, optionally discarding the document.
|
Object |
getParser()
Allows to access the underlying parser.
|
Object |
getRegisteredContentHandler()
Deprecated.
This method is no longer used; implementations will always throw
UnsupportedOperationException . |
boolean |
isCache() |
boolean |
isCompleted() |
int |
next()
Proceed the parser one step and return the event value.
|
void |
registerExternalContentHandler(Object obj)
Deprecated.
This method is no longer used; implementations will always throw
UnsupportedOperationException . |
void |
setCache(boolean b) |
int next() throws OMException
OMException
OMException
void discard(OMElement el) throws OMException
OMNode.discard()
to discard elements.OMException
void setCache(boolean b) throws OMException
b
- OMException
OMException
boolean isCache()
Object getParser()
boolean isCompleted()
OMDocument getDocument()
OMDocument
instanceUnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is
associated with an OMSourcedElement
OMElement getDocumentElement()
OMDocument.getOMDocumentElement()
on the document returned by
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.
OMException
- if a parse error occursUnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is
associated with an OMSourcedElement
OMElement getDocumentElement(boolean discardDocument)
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.discardDocument
- specifies whether the document should be discardedOMException
- if a parse error occursUnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is
associated with an OMSourcedElement
short getBuilderType()
OMConstants.PUSH_TYPE_BUILDER
or OMConstants.PULL_TYPE_BUILDER
.void registerExternalContentHandler(Object obj)
UnsupportedOperationException
.UnsupportedOperationException
if such handler registration is not supported.obj
- the external content handlerObject getRegisteredContentHandler()
UnsupportedOperationException
.String getCharacterEncoding()
void close()
void detach()
OMXMLBuilderFactory
to create
the builder:
Source object type | Action performed by this method |
---|---|
InputStream , Reader , StreamSource with InputStream or
Reader |
The remaining unprocessed content of the stream is read into memory so that it can be safely closed. Note that this method doesn't close the stream; this is the responsibility of the caller. |
StreamSource with system ID and no stream |
The remaining unprocessed content of the document is read into memory and the associated stream is closed. |
Node , DOMSource , SAXSource |
The object model is built completely. |
Attachments |
All MIME parts are fetched so that the stream from which the Attachments object
has been created can safely be closed. |
Copyright © The Apache Software Foundation. All Rights Reserved.