Package org.apache.axiom.om
Interface OMXMLParserWrapper
-
- All Known Implementing Classes:
MTOMStAXSOAPModelBuilder,StAXBuilder,StAXOMBuilder,StAXSOAPModelBuilder,XOPAwareStAXOMBuilder
public interface OMXMLParserWrapperInterface OMXMLParserWrapper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close this builder.voiddiscard(OMElement el)Discards the current element.shortgetBuilderType()Returns the type of the builder.StringgetCharacterEncoding()Returns the encoding style of the XML dataOMDocumentgetDocument()Get the document being built by this builder.OMElementgetDocumentElement()Get the document element, i.e.OMElementgetDocumentElement(boolean discardDocument)Get the document element, optionally discarding the document.ObjectgetParser()Allows to access the underlying parser.ObjectgetRegisteredContentHandler()get the registered external content handlerbooleanisCache()booleanisCompleted()intnext()Proceed the parser one step and return the event value.voidregisterExternalContentHandler(Object obj)Registers an external content handler.voidsetCache(boolean b)
-
-
-
Method Detail
-
next
int next() throws OMException
Proceed the parser one step and return the event value.- Returns:
- Returns int.
- Throws:
OMExceptionOMException
-
discard
void discard(OMElement el) throws OMException
Discards the current element. This will remove the given element and its descendants.- Parameters:
el-- Throws:
OMExceptionOMException
-
setCache
void setCache(boolean b) throws OMException- Parameters:
b-- Throws:
OMExceptionOMException
-
isCache
boolean isCache()
- Returns:
- true if caching
-
getParser
Object getParser()
Allows to access the underlying parser. Since the parser depends on the underlying implementation, an Object is returned. However the implementations may have restrictions in letting access to the parser.- Returns:
- Returns Object.
-
isCompleted
boolean isCompleted()
- Returns:
- Returns the complete status.
-
getDocument
OMDocument getDocument()
Get the document being built by this builder.- Returns:
- the
OMDocumentinstance
-
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().- Returns:
- the document element
-
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 thediscardDocumentparameter 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
-
getBuilderType
short getBuilderType()
Returns the type of the builder. Can be eitherOMConstants.PUSH_TYPE_BUILDERorOMConstants.PULL_TYPE_BUILDER.- Returns:
- Returns short.
-
registerExternalContentHandler
void registerExternalContentHandler(Object obj)
Registers an external content handler. Especially useful for push type builders. Throws an unsupportedOperationException if such handler registration is not supported.- Parameters:
obj-
-
getRegisteredContentHandler
Object getRegisteredContentHandler()
get the registered external content handler- Returns:
- Returns Object.
-
getCharacterEncoding
String getCharacterEncoding()
Returns the encoding style of the XML data- Returns:
- the character encoding, defaults to "UTF-8"
-
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.
-
-