org.apache.axiom.om.impl.builder
Class StAXOMBuilder

java.lang.Object
  extended by org.apache.axiom.om.impl.builder.StAXBuilder
      extended by org.apache.axiom.om.impl.builder.StAXOMBuilder
All Implemented Interfaces:
OMXMLParserWrapper
Direct Known Subclasses:
StAXSOAPModelBuilder, XOPAwareStAXOMBuilder

public class StAXOMBuilder
extends StAXBuilder

StAX based builder that produces a pure XML infoset compliant object model.


Field Summary
 
Fields inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
_isClosed, _releaseParserOnClose, cache, charEncoding, customBuilderForPayload, customBuilders, document, done, elementLevel, isDataHandlerAware, lastNode, maxDepthForCustomBuilders, omfactory, parser, parserAccessed
 
Constructor Summary
StAXOMBuilder()
          Init() *must* be called after creating the builder using this constructor.
StAXOMBuilder(java.io.InputStream inStream)
           
StAXOMBuilder(OMFactory ombuilderFactory, javax.xml.stream.XMLStreamReader parser)
          Constructor StAXOMBuilder.
StAXOMBuilder(OMFactory factory, javax.xml.stream.XMLStreamReader parser, OMElement element)
          Constructor linked to existing element.
StAXOMBuilder(OMFactory factory, javax.xml.stream.XMLStreamReader parser, OMElement element, java.lang.String characterEncoding)
          Constructor linked to existing element.
StAXOMBuilder(java.lang.String filePath)
           
StAXOMBuilder(javax.xml.stream.XMLStreamReader parser)
          Constructor StAXOMBuilder.
 
Method Summary
protected  OMNode createComment()
          Method createOMText.
protected  OMNode createDTD()
          Method createDTD.
protected  OMNode createNextOMElement()
          Creates a new OMElement using either a CustomBuilder or the default Builder mechanism.
protected  OMNode createOMElement()
          Method createOMElement.
protected  OMNode createPI()
          Method createPI.
protected  java.lang.String createPrefix()
           
protected  OMNode createWithCustomBuilder(CustomBuilder customBuilder, OMFactory factory)
           
protected  void endElement()
           
 OMElement getDocumentElement()
          Method getDocumentElement.
 boolean isLookahead()
           
 boolean isNamespaceURIInterning()
           
protected  void logParserState()
          Dump the current event of the parser.
 boolean lookahead()
          This method looks ahead to the next start element.
 int next()
          Method next.
protected  void processNamespaceData(OMElement node)
          Method processNamespaceData.
 void setDoDebug(boolean doDebug)
          Deprecated.  
 void setNamespaceURIInterning(boolean b)
          Set namespace uri interning
 
Methods inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
close, createOMText, discard, getAttributeCount, getAttributeName, getAttributeNamespace, getAttributePrefix, getBuilderType, getCharacterEncoding, getCharsetEncoding, getCustomBuilder, getDocument, getLastNode, getName, getNamespace, getNamespaceCount, getNamespacePrefix, getNamespaceUri, getParser, getPrefix, getReaderProperty, getRegisteredContentHandler, getText, init, isCache, isClosed, isCompleted, isDataHandlerAware, processAttributes, registerCustomBuilder, registerCustomBuilderForPayload, registerExternalContentHandler, releaseParserOnClose, reset, setCache, setIsDataHandlerAware, setOMBuilderFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXOMBuilder

public StAXOMBuilder(OMFactory ombuilderFactory,
                     javax.xml.stream.XMLStreamReader parser)
Constructor StAXOMBuilder.

Parameters:
ombuilderFactory -
parser -

StAXOMBuilder

public StAXOMBuilder(OMFactory factory,
                     javax.xml.stream.XMLStreamReader parser,
                     OMElement element,
                     java.lang.String characterEncoding)
Constructor linked to existing element.

Parameters:
factory -
parser -
element -
characterEncoding - of existing element

StAXOMBuilder

public StAXOMBuilder(OMFactory factory,
                     javax.xml.stream.XMLStreamReader parser,
                     OMElement element)
Constructor linked to existing element.

Parameters:
factory -
parser -
element -

StAXOMBuilder

public StAXOMBuilder(java.lang.String filePath)
              throws javax.xml.stream.XMLStreamException,
                     java.io.FileNotFoundException
Parameters:
filePath - - Path to the XML file
Throws:
javax.xml.stream.XMLStreamException
java.io.FileNotFoundException

StAXOMBuilder

public StAXOMBuilder(javax.xml.stream.XMLStreamReader parser)
Constructor StAXOMBuilder.

Parameters:
parser -

StAXOMBuilder

public StAXOMBuilder(java.io.InputStream inStream)
              throws javax.xml.stream.XMLStreamException
Parameters:
inStream - - instream which contains the XML
Throws:
javax.xml.stream.XMLStreamException

StAXOMBuilder

public StAXOMBuilder()
Init() *must* be called after creating the builder using this constructor.

Method Detail

next

public int next()
         throws OMException
Method next.

Specified by:
next in interface OMXMLParserWrapper
Specified by:
next in class StAXBuilder
Returns:
Returns int.
Throws:
OMException

createNextOMElement

protected OMNode createNextOMElement()
Creates a new OMElement using either a CustomBuilder or the default Builder mechanism.

Returns:

createWithCustomBuilder

protected OMNode createWithCustomBuilder(CustomBuilder customBuilder,
                                         OMFactory factory)

logParserState

protected void logParserState()
Dump the current event of the parser.


createOMElement

protected OMNode createOMElement()
                          throws OMException
Method createOMElement.

Specified by:
createOMElement in class StAXBuilder
Returns:
Returns OMNode.
Throws:
OMException

createComment

protected OMNode createComment()
                        throws OMException
Method createOMText.

Returns:
Returns OMNode.
Throws:
OMException

createDTD

protected OMNode createDTD()
                    throws OMException
Method createDTD.

Returns:
Returns OMNode.
Throws:
OMException

createPI

protected OMNode createPI()
                   throws OMException
Method createPI.

Returns:
Returns OMNode.
Throws:
OMException

endElement

protected void endElement()

getDocumentElement

public OMElement getDocumentElement()
Method getDocumentElement.

Returns:
Returns root element.

processNamespaceData

protected void processNamespaceData(OMElement node)
Method processNamespaceData.

Specified by:
processNamespaceData in class StAXBuilder
Parameters:
node -

setDoDebug

public void setDoDebug(boolean doDebug)
Deprecated. 

Parameters:
doDebug -

createPrefix

protected java.lang.String createPrefix()

setNamespaceURIInterning

public void setNamespaceURIInterning(boolean b)
Set namespace uri interning

Parameters:
b -

isNamespaceURIInterning

public boolean isNamespaceURIInterning()
Returns:
if namespace uri interning

lookahead

public boolean lookahead()
This method looks ahead to the next start element.

Returns:
true if successful

isLookahead

public boolean isLookahead()


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