org.apache.axiom.om
Interface OMXMLParserWrapper

All Known Subinterfaces:
SOAPModelBuilder
All Known Implementing Classes:
MTOMStAXSOAPModelBuilder, SAXOMBuilder, StAXBuilder, StAXOMBuilder, StAXSOAPModelBuilder, XOPAwareStAXOMBuilder

public interface OMXMLParserWrapper

Interface OMXMLParserWrapper


Method Summary
 void close()
          Close this builder.
 void discard(OMElement el)
          Deprecated. Use OMNode.discard() to discard elements.
 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. 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()
          get the registered external content handler
 boolean isCache()
           
 boolean isCompleted()
           
 int next()
          Proceed the parser one step and return the event value.
 void registerExternalContentHandler(Object obj)
          Registers an external content handler.
 void setCache(boolean b)
           
 

Method Detail

next

int next()
         throws OMException
Proceed the parser one step and return the event value.

Returns:
Returns int.
Throws:
OMException
OMException

discard

void discard(OMElement el)
             throws OMException
Deprecated. Use OMNode.discard() to discard elements.

Throws:
OMException

setCache

void setCache(boolean b)
              throws OMException
Parameters:
b -
Throws:
OMException
OMException

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 OMDocument instance
Throws:
UnsupportedOperationException - if there is no document linked to this builder; this may occur if the builder is associated with an OMSourcedElement

getDocumentElement

OMElement getDocumentElement()
Get the document element, i.e. the root element of the document. Using this method is equivalent to using 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.

Returns:
the document element
Throws:
OMException - if a parse error occurs
UnsupportedOperationException - if there is no document linked to this builder; this may occur if the builder is associated with an OMSourcedElement

getDocumentElement

OMElement getDocumentElement(boolean discardDocument)
Get the document element, optionally discarding the document. The return value of this method is the same as 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.

Parameters:
discardDocument - specifies whether the document should be discarded
Returns:
the document element
Throws:
OMException - if a parse error occurs
UnsupportedOperationException - if there is no document linked to this builder; this may occur if the builder is associated with an OMSourcedElement

getBuilderType

short getBuilderType()
Returns the type of the builder. Can be either OMConstants.PUSH_TYPE_BUILDER or OMConstants.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.



Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.