|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.om.impl.builder.StAXBuilder
public abstract class StAXBuilder
OM should be able to be built from any data source. And the model it builds may be a SOAP specific one or just an XML model. This class will give some common functionality of OM Building from StAX.
| Field Summary | |
|---|---|
protected boolean |
_isClosed
|
protected boolean |
_releaseParserOnClose
|
protected boolean |
cache
Field cache |
protected java.lang.String |
charEncoding
|
protected CustomBuilder |
customBuilderForPayload
|
protected java.util.Map |
customBuilders
|
protected DataHandlerReader |
dataHandlerReader
Reference to the DataHandlerReader extension of the parser, or null if
the parser doesn't support this extension. |
protected OMDocument |
document
|
protected boolean |
done
Field done |
protected int |
elementLevel
Element level is the depth of the element. |
protected OMNode |
lastNode
Field lastNode |
protected int |
maxDepthForCustomBuilders
|
protected OMFactory |
omfactory
Field omfactory |
protected javax.xml.stream.XMLStreamReader |
parser
Field parser |
protected boolean |
parserAccessed
Field parserAccessed |
protected java.lang.Exception |
parserException
Stores exceptions thrown by the parser. |
| Constructor Summary | |
|---|---|
protected |
StAXBuilder()
Init() *must* be called after creating the builder using this constructor. |
protected |
StAXBuilder(OMFactory ombuilderFactory,
javax.xml.stream.XMLStreamReader parser)
Constructor StAXBuilder. |
protected |
StAXBuilder(OMFactory ombuilderFactory,
javax.xml.stream.XMLStreamReader parser,
java.lang.String characterEncoding)
Constructor StAXBuilder. |
protected |
StAXBuilder(javax.xml.stream.XMLStreamReader parser)
Constructor StAXBuilder. |
| Method Summary | |
|---|---|
void |
close()
Close this builder. |
protected abstract OMNode |
createOMElement()
This method is called with the XMLStreamConstants.START_ELEMENT event. |
protected OMNode |
createOMText(int textType)
Method createOMText. |
void |
discard(OMElement element)
Method discard. |
int |
getAttributeCount()
Method getAttributeCount. |
java.lang.String |
getAttributeName(int arg)
Method getAttributeName. |
java.lang.String |
getAttributeNamespace(int arg)
Method getAttributeNamespace. |
java.lang.String |
getAttributePrefix(int arg)
Method getAttributePrefix. |
short |
getBuilderType()
Returns the type of the builder. |
java.lang.String |
getCharacterEncoding()
Returns the encoding style of the XML data |
java.lang.String |
getCharsetEncoding()
|
protected CustomBuilder |
getCustomBuilder(java.lang.String namespace,
java.lang.String localPart)
Return CustomBuilder associated with the namespace/localPart |
OMDocument |
getDocument()
Get the document being built by this builder. |
OMNode |
getLastNode()
|
java.lang.String |
getName()
Method getName. |
java.lang.String |
getNamespace()
Method getNamespace. |
int |
getNamespaceCount()
Method getNamespaceCount. |
java.lang.String |
getNamespacePrefix(int index)
Method getNamespacePrefix. |
java.lang.String |
getNamespaceUri(int index)
Method getNamespaceUri. |
java.lang.Object |
getParser()
Get the underlying XMLStreamReader used by this builder. |
java.lang.String |
getPrefix()
Method getPrefix. |
java.lang.Object |
getReaderProperty(java.lang.String name)
Get the value of a feature/property from the underlying XMLStreamReader implementation without accessing the XMLStreamReader. |
java.lang.Object |
getRegisteredContentHandler()
Method getRegisteredContentHandler. |
java.lang.String |
getText()
Method getText. |
void |
init(java.io.InputStream inputStream,
java.lang.String charSetEncoding,
java.lang.String url,
java.lang.String contentType)
Deprecated. Not used anywhere |
boolean |
isCache()
|
boolean |
isClosed()
|
boolean |
isCompleted()
Method isCompleted. |
abstract int |
next()
Forwards the parser one step further, if parser is not completed yet. |
protected void |
processAttributes(OMElement node)
Method processAttributes. |
protected abstract void |
processNamespaceData(OMElement node)
Method processNamespaceData. |
CustomBuilder |
registerCustomBuilder(javax.xml.namespace.QName qName,
int maxDepth,
CustomBuilder customBuilder)
Register a CustomBuilder associated with the indicated QName. |
CustomBuilder |
registerCustomBuilderForPayload(CustomBuilder customBuilder)
Register a CustomBuilder for a payload. |
void |
registerExternalContentHandler(java.lang.Object obj)
Method registerExternalContentHandler. |
void |
releaseParserOnClose(boolean value)
Indicate if the parser resource should be release when closed. |
void |
reset(OMNode node)
Method reset. |
void |
setCache(boolean b)
Method setCache. |
void |
setOMBuilderFactory(OMFactory ombuilderFactory)
Method setOMBuilderFactory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.axiom.om.OMXMLParserWrapper |
|---|
getDocumentElement, getDocumentElement |
| Field Detail |
|---|
protected javax.xml.stream.XMLStreamReader parser
protected OMFactory omfactory
protected OMNode lastNode
protected boolean done
protected boolean cache
protected boolean parserAccessed
protected OMDocument document
protected java.lang.String charEncoding
protected boolean _isClosed
protected boolean _releaseParserOnClose
protected CustomBuilder customBuilderForPayload
protected java.util.Map customBuilders
protected int maxDepthForCustomBuilders
protected DataHandlerReader dataHandlerReader
DataHandlerReader extension of the parser, or null if
the parser doesn't support this extension.
protected int elementLevel
protected java.lang.Exception parserException
| Constructor Detail |
|---|
protected StAXBuilder(OMFactory ombuilderFactory,
javax.xml.stream.XMLStreamReader parser)
ombuilderFactory - parser -
protected StAXBuilder(OMFactory ombuilderFactory,
javax.xml.stream.XMLStreamReader parser,
java.lang.String characterEncoding)
ombuilderFactory - parser - characterEncoding - protected StAXBuilder(javax.xml.stream.XMLStreamReader parser)
parser - protected StAXBuilder()
| Method Detail |
|---|
public void init(java.io.InputStream inputStream,
java.lang.String charSetEncoding,
java.lang.String url,
java.lang.String contentType)
throws OMException
OMExceptionpublic void setOMBuilderFactory(OMFactory ombuilderFactory)
ombuilderFactory - protected abstract void processNamespaceData(OMElement node)
node - protected void processAttributes(OMElement node)
node -
protected OMNode createOMText(int textType)
throws OMException
OMException
public void reset(OMNode node)
throws OMException
node -
OMException
public void discard(OMElement element)
throws OMException
discard in interface OMXMLParserWrapperelement -
OMException
public java.lang.String getText()
throws OMException
OMException
public java.lang.String getNamespace()
throws OMException
OMException
public int getNamespaceCount()
throws OMException
OMException
public java.lang.String getNamespacePrefix(int index)
throws OMException
index -
OMException
public java.lang.String getNamespaceUri(int index)
throws OMException
index -
OMExceptionpublic void setCache(boolean b)
setCache in interface OMXMLParserWrapperb - public boolean isCache()
isCache in interface OMXMLParserWrapper
public java.lang.String getName()
throws OMException
OMException
public java.lang.String getPrefix()
throws OMException
OMException
public int getAttributeCount()
throws OMException
OMException
public java.lang.String getAttributeNamespace(int arg)
throws OMException
arg -
OMException
public java.lang.String getAttributeName(int arg)
throws OMException
arg -
OMException
public java.lang.String getAttributePrefix(int arg)
throws OMException
arg -
OMExceptionpublic java.lang.Object getParser()
XMLStreamReader used by this builder. Note that for this type of
builder, accessing the underlying parser implies that can no longer be used, and any attempt
to call next() will result in an exception.
getParser in interface OMXMLParserWrapperXMLStreamReader object used by this builder. Note that the constraints
described in the Javadoc of the reader parameter of the
CustomBuilder.create(String, String, OMContainer, XMLStreamReader, OMFactory)
method also apply to the stream reader returned by this method, i.e.:
XOPUtils.getXOPEncodedStream(XMLStreamReader)
to get an XOP encoded stream from the return value.
XMLStreamReaderUtils.getOriginalXMLStreamReader(XMLStreamReader).
java.lang.IllegalStateException - if the parser has already been accessedpublic boolean isCompleted()
isCompleted in interface OMXMLParserWrapper
protected abstract OMNode createOMElement()
throws OMException
OMException
public abstract int next()
throws OMException
next in interface OMXMLParserWrapperOMException
public CustomBuilder registerCustomBuilder(javax.xml.namespace.QName qName,
int maxDepth,
CustomBuilder customBuilder)
qName - maxDepth - indicate the maximum depth that this qname will be found. (root = 0)customBuilder -
public CustomBuilder registerCustomBuilderForPayload(CustomBuilder customBuilder)
customBuilder -
protected CustomBuilder getCustomBuilder(java.lang.String namespace,
java.lang.String localPart)
namespace - localPart -
public short getBuilderType()
OMXMLParserWrapperOMConstants.PUSH_TYPE_BUILDER
or OMConstants.PULL_TYPE_BUILDER.
getBuilderType in interface OMXMLParserWrapperpublic void registerExternalContentHandler(java.lang.Object obj)
registerExternalContentHandler in interface OMXMLParserWrapperobj - public java.lang.Object getRegisteredContentHandler()
getRegisteredContentHandler in interface OMXMLParserWrapperpublic OMDocument getDocument()
OMXMLParserWrapper
getDocument in interface OMXMLParserWrapperOMDocument instancepublic java.lang.String getCharsetEncoding()
public OMNode getLastNode()
public void close()
OMXMLParserWrapper
close in interface OMXMLParserWrapper
public java.lang.Object getReaderProperty(java.lang.String name)
throws java.lang.IllegalArgumentException
name -
java.lang.IllegalArgumentExceptionpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface OMXMLParserWrapperpublic boolean isClosed()
public void releaseParserOnClose(boolean value)
value - boolean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||