Package org.apache.axiom.om
Interface OMXMLParserWrapper
-
- All Known Subinterfaces:
SOAPModelBuilder
public interface OMXMLParserWrapper
Interface OMXMLParserWrapper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.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.boolean
isCompleted()
-
-
-
Method Detail
-
isCompleted
boolean isCompleted()
- Returns:
- Returns the complete status.
-
getDocument
OMDocument getDocument()
Get the document being built by this builder.- Returns:
- the
OMDocument
instance - Throws:
UnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is associated with anOMSourcedElement
-
getDocumentElement
OMElement getDocumentElement()
Get the document element, i.e. the root element of the document. Using this method is equivalent to usingOMDocument.getOMDocumentElement()
on the document returned bygetDocument()
.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. anOMException
will be thrown.- Returns:
- the document element
- Throws:
OMException
- if a parse error occursUnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is associated with anOMSourcedElement
-
getDocumentElement
OMElement getDocumentElement(boolean discardDocument)
Get the document element, optionally discarding the document. The return value of this method is the same asgetDocumentElement()
. However, if thediscardDocument
parameter is set totrue
, then the document element is removed from the document and the document itself is discarded. In contrast to usingOMNode.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.- Parameters:
discardDocument
- specifies whether the document should be discarded- Returns:
- the document element
- Throws:
OMException
- if a parse error occursUnsupportedOperationException
- if there is no document linked to this builder; this may occur if the builder is associated with anOMSourcedElement
-
close
void close()
Close this builder. This method frees the resources associated with this builder. In particular, it releases the resources held by the underlying parser. This method does not close the underlying input source.
-
detach
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. The effect of this method depends on the type of source object passed toOMXMLBuilderFactory
to create the builder:Actions performed by the detach()
methodSource object type Action performed by this method InputStream
,Reader
,StreamSource
withInputStream
orReader
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 streamThe 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.
-
-