org.apache.axiom.om.impl.llom
Class OMStAXWrapper

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMStAXWrapper
All Implemented Interfaces:
javax.xml.stream.XMLStreamConstants, javax.xml.stream.XMLStreamReader, OMAttachmentAccessor, OMXMLStreamReader

public class OMStAXWrapper
extends Object
implements OMXMLStreamReader, javax.xml.stream.XMLStreamConstants

Note - This class also implements the streaming constants interface to get access to the StAX constants


Field Summary
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
OMStAXWrapper(OMXMLParserWrapper builder, OMElement startNode)
          When constructing the OMStaxWrapper, the creator must produce the builder (an instance of the OMXMLparserWrapper of the input) and the Element Node to start parsing.
OMStAXWrapper(OMXMLParserWrapper builder, OMElement startNode, boolean cache)
          Constructor OMStAXWrapper.
 
Method Summary
 void close()
          Method close.
 int getAttributeCount()
           
 String getAttributeLocalName(int i)
           
 javax.xml.namespace.QName getAttributeName(int i)
           
 String getAttributeNamespace(int i)
           
 String getAttributePrefix(int i)
           
 String getAttributeType(int i)
           
 String getAttributeValue(int i)
           
 String getAttributeValue(String s, String s1)
          Method getAttributeValue.
 OMXMLParserWrapper getBuilder()
           
 String getCharacterEncodingScheme()
          Method getCharacterEncodingScheme.
 javax.activation.DataHandler getDataHandler(String blobcid)
           
 String getElementText()
           
 String getEncoding()
          Method getEncoding.
 int getEventType()
           
 String getLocalName()
           
 javax.xml.stream.Location getLocation()
          Method getLocation.
 javax.xml.namespace.QName getName()
           
 javax.xml.namespace.NamespaceContext getNamespaceContext()
          Method getNamespaceContext.
 int getNamespaceCount()
           
 String getNamespacePrefix(int i)
           
 String getNamespaceURI()
           
 String getNamespaceURI(int i)
           
 String getNamespaceURI(String prefix)
          Method getNamespaceURI.
 String getPIData()
          Method getPIData.
 String getPITarget()
          Method getPITarget.
 String getPrefix()
           
 Object getProperty(String s)
          Method getProperty.
 String getText()
           
 char[] getTextCharacters()
           
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
           
 int getTextLength()
           
 int getTextStart()
           
 String getVersion()
          Method getVersion.
 boolean hasName()
           
 boolean hasNext()
          Method hasNext.
 boolean hasText()
           
 boolean isAllowSwitching()
          Method isAllowSwitching.
 boolean isAttributeSpecified(int i)
           
 boolean isCharacters()
          Method isCharacters.
 boolean isClosed()
           
 boolean isEndElement()
          Method isEndElement.
 boolean isInlineMTOM()
          By default, an OMText item that has an MTOM datahandler will be rendered as a inlined text event.
 boolean isNamespaceURIInterning()
           
 boolean isStandalone()
          Method isStandalone.
 boolean isStartElement()
          Method isStartElement.
 boolean isWhiteSpace()
          Method isWhiteSpace.
 int next()
          Method next.
 int nextTag()
          Returns the next tag.
 void releaseParserOnClose(boolean value)
          Indicate if the parser resource should be release when closed.
 void require(int i, String s, String s1)
           
 void setAllowSwitching(boolean b)
          Method setAllowSwitching.
 void setInlineMTOM(boolean value)
           
 void setNamespaceURIInterning(boolean b)
          Set namespace uri interning
 void setParser(javax.xml.stream.XMLStreamReader parser)
           
 boolean standaloneSet()
          Method standaloneSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMStAXWrapper

public OMStAXWrapper(OMXMLParserWrapper builder,
                     OMElement startNode)
When constructing the OMStaxWrapper, the creator must produce the builder (an instance of the OMXMLparserWrapper of the input) and the Element Node to start parsing. The wrapper will parse(proceed) until the end of the given element. Hence care should be taken to pass the root element if the entire document is needed.

Parameters:
builder -
startNode -

OMStAXWrapper

public OMStAXWrapper(OMXMLParserWrapper builder,
                     OMElement startNode,
                     boolean cache)
Constructor OMStAXWrapper.

Parameters:
builder -
startNode -
cache -
Method Detail

setAllowSwitching

public void setAllowSwitching(boolean b)
Method setAllowSwitching.

Parameters:
b -

isAllowSwitching

public boolean isAllowSwitching()
Method isAllowSwitching.

Returns:
Returns boolean.

setNamespaceURIInterning

public void setNamespaceURIInterning(boolean b)
Set namespace uri interning

Parameters:
b -

isNamespaceURIInterning

public boolean isNamespaceURIInterning()
Returns:
if namespace uri interning

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.
See Also:
XMLStreamReader.getPrefix()

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.
See Also:
XMLStreamReader.getNamespaceURI()

hasName

public boolean hasName()
Specified by:
hasName in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.
See Also:
XMLStreamReader.hasName()

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.
See Also:
XMLStreamReader.getLocalName()

getName

public javax.xml.namespace.QName getName()
Specified by:
getName in interface javax.xml.stream.XMLStreamReader
Returns:
Returns QName.
See Also:
XMLStreamReader.getName()

hasText

public boolean hasText()
Specified by:
hasText in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.
See Also:
XMLStreamReader.hasText()

getTextLength

public int getTextLength()
Specified by:
getTextLength in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
See Also:
XMLStreamReader.getTextLength()

getTextStart

public int getTextStart()
Specified by:
getTextStart in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
See Also:
XMLStreamReader.getTextStart()

getTextCharacters

public int getTextCharacters(int sourceStart,
                             char[] target,
                             int targetStart,
                             int length)
                      throws javax.xml.stream.XMLStreamException
Specified by:
getTextCharacters in interface javax.xml.stream.XMLStreamReader
Parameters:
sourceStart -
target -
targetStart -
length -
Returns:
Returns int.
Throws:
javax.xml.stream.XMLStreamException
See Also:
XMLStreamReader.getTextCharacters(int, char[], int, int)

getTextCharacters

public char[] getTextCharacters()
Specified by:
getTextCharacters in interface javax.xml.stream.XMLStreamReader
Returns:
Returns char[].
See Also:
XMLStreamReader.getTextCharacters()

getText

public String getText()
Specified by:
getText in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.
See Also:
XMLStreamReader.getText()

getEventType

public int getEventType()
Specified by:
getEventType in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
See Also:
XMLStreamReader.getEventType()

getNamespaceURI

public String getNamespaceURI(int i)
Specified by:
getNamespaceURI in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getNamespaceURI(java.lang.String)

getNamespacePrefix

public String getNamespacePrefix(int i)
Specified by:
getNamespacePrefix in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getNamespacePrefix(int)

getNamespaceCount

public int getNamespaceCount()
Specified by:
getNamespaceCount in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
See Also:
XMLStreamReader.getNamespaceCount()

isAttributeSpecified

public boolean isAttributeSpecified(int i)
Specified by:
isAttributeSpecified in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns boolean.
See Also:
XMLStreamReader.isAttributeSpecified(int)

getAttributeValue

public String getAttributeValue(int i)
Specified by:
getAttributeValue in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getAttributeValue(java.lang.String, java.lang.String)

getAttributeType

public String getAttributeType(int i)
Specified by:
getAttributeType in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getAttributeType(int)

getAttributePrefix

public String getAttributePrefix(int i)
Specified by:
getAttributePrefix in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getAttributePrefix(int)

getAttributeLocalName

public String getAttributeLocalName(int i)
Specified by:
getAttributeLocalName in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getAttributeLocalName(int)

getAttributeNamespace

public String getAttributeNamespace(int i)
Specified by:
getAttributeNamespace in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns String.
See Also:
XMLStreamReader.getAttributeNamespace(int)

getAttributeName

public javax.xml.namespace.QName getAttributeName(int i)
Specified by:
getAttributeName in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
Returns:
Returns QName.
See Also:
XMLStreamReader.getAttributeName(int)

getAttributeCount

public int getAttributeCount()
Specified by:
getAttributeCount in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
See Also:
XMLStreamReader.getAttributeCount()

getAttributeValue

public String getAttributeValue(String s,
                                String s1)
Method getAttributeValue.

Specified by:
getAttributeValue in interface javax.xml.stream.XMLStreamReader
Parameters:
s -
s1 -
Returns:
Returns String.

isWhiteSpace

public boolean isWhiteSpace()
Method isWhiteSpace.

Specified by:
isWhiteSpace in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

isCharacters

public boolean isCharacters()
Method isCharacters.

Specified by:
isCharacters in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

isEndElement

public boolean isEndElement()
Method isEndElement.

Specified by:
isEndElement in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

require

public void require(int i,
                    String s,
                    String s1)
             throws javax.xml.stream.XMLStreamException
Specified by:
require in interface javax.xml.stream.XMLStreamReader
Parameters:
i -
s -
s1 -
Throws:
javax.xml.stream.XMLStreamException
See Also:
XMLStreamReader.require(int, String, String)

isStartElement

public boolean isStartElement()
Method isStartElement.

Specified by:
isStartElement in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

getNamespaceURI

public String getNamespaceURI(String prefix)
Method getNamespaceURI.

Specified by:
getNamespaceURI in interface javax.xml.stream.XMLStreamReader
Parameters:
prefix -
Returns:
Returns String.

close

public void close()
           throws javax.xml.stream.XMLStreamException
Method close.

Specified by:
close in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

hasNext

public boolean hasNext()
                throws javax.xml.stream.XMLStreamException
Method hasNext.

Specified by:
hasNext in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.
Throws:
javax.xml.stream.XMLStreamException

nextTag

public int nextTag()
            throws javax.xml.stream.XMLStreamException
Returns the next tag.

Specified by:
nextTag in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
Throws:
OMStreamingException
javax.xml.stream.XMLStreamException

getElementText

public String getElementText()
                      throws javax.xml.stream.XMLStreamException
Specified by:
getElementText in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.
Throws:
javax.xml.stream.XMLStreamException
See Also:
XMLStreamReader.getElementText()

next

public int next()
         throws javax.xml.stream.XMLStreamException
Method next.

Specified by:
next in interface javax.xml.stream.XMLStreamReader
Returns:
Returns int.
Throws:
javax.xml.stream.XMLStreamException

getProperty

public Object getProperty(String s)
                   throws IllegalArgumentException
Method getProperty.

Specified by:
getProperty in interface javax.xml.stream.XMLStreamReader
Parameters:
s -
Returns:
Returns Object.
Throws:
IllegalArgumentException

getNamespaceContext

public javax.xml.namespace.NamespaceContext getNamespaceContext()
Method getNamespaceContext.

Specified by:
getNamespaceContext in interface javax.xml.stream.XMLStreamReader
Returns:
Returns NamespaceContext.

getEncoding

public String getEncoding()
Method getEncoding.

Specified by:
getEncoding in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.

getLocation

public javax.xml.stream.Location getLocation()
Method getLocation.

Specified by:
getLocation in interface javax.xml.stream.XMLStreamReader
Returns:
Returns Location.

getVersion

public String getVersion()
Method getVersion.

Specified by:
getVersion in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.

isStandalone

public boolean isStandalone()
Method isStandalone.

Specified by:
isStandalone in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

standaloneSet

public boolean standaloneSet()
Method standaloneSet.

Specified by:
standaloneSet in interface javax.xml.stream.XMLStreamReader
Returns:
Returns boolean.

getCharacterEncodingScheme

public String getCharacterEncodingScheme()
Method getCharacterEncodingScheme.

Specified by:
getCharacterEncodingScheme in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.

getPITarget

public String getPITarget()
Method getPITarget.

Specified by:
getPITarget in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.

getPIData

public String getPIData()
Method getPIData.

Specified by:
getPIData in interface javax.xml.stream.XMLStreamReader
Returns:
Returns String.

setParser

public void setParser(javax.xml.stream.XMLStreamReader parser)

getBuilder

public OMXMLParserWrapper getBuilder()

isClosed

public boolean isClosed()
Returns:
if parser is closed

releaseParserOnClose

public void releaseParserOnClose(boolean value)
Indicate if the parser resource should be release when closed.

Parameters:
value - boolean

getDataHandler

public javax.activation.DataHandler getDataHandler(String blobcid)
Specified by:
getDataHandler in interface OMAttachmentAccessor
Returns:
The DataHandler of the mime part referred by the Content-Id or *null* if the mime part referred by the content-id does not exist

isInlineMTOM

public boolean isInlineMTOM()
Description copied from interface: OMXMLStreamReader
By default, an OMText item that has an MTOM datahandler will be rendered as a inlined text event.

Specified by:
isInlineMTOM in interface OMXMLStreamReader
Returns:
true if inlined as TEXT, false if XOP_INCLUDE is used

setInlineMTOM

public void setInlineMTOM(boolean value)
Specified by:
setInlineMTOM in interface OMXMLStreamReader
Parameters:
value - set to true if inlining of text is desired (default) throw OMException if not the value is not supported.


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