Class ADBXMLStreamReaderImpl
java.lang.Object
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl
- All Implemented Interfaces:
XMLStreamConstants,XMLStreamReader,org.apache.axiom.ext.stax.BlobReader,Constants,ADBXMLStreamReader
public class ADBXMLStreamReaderImpl
extends Object
implements ADBXMLStreamReader, org.apache.axiom.ext.stax.BlobReader
This is the new implementation of the ADBpullaparser. The approach here is simple When the pull
parser needs to generate events for a particular name-value(s) pair it always handes over
(delegates) the task to another pull parser which knows how to deal with it The common types of
name value pairs we'll come across are 1. String name/QName name - String value 2. String
name/QName name - String[] value 3. OMElementkey - OMElement value 4. QName name/String name -
ADBBean value 5. QName name/String name - Java bean 5. QName name/String name - Datahandler
As for the attributes, these are the possible combinations in the array 1. String name/QName name
- String value 2. OMAttributeKey - OMAttribute
Note that certain array methods have been deliberately removed to avoid complications. The
generated code will take the trouble to lay the elements of the array in the correct order
Hence there will be a parser impl that knows how to handle these types, and this parent parser
will always delegate these tasks to the child pullparasers in effect this is one huge state
machine that has only a few states and delegates things down to the child parsers whenever
possible
-
Field Summary
Fields inherited from interface org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader
ELEMENT_TEXTFields inherited from interface org.apache.axiom.ext.stax.BlobReader
PROPERTYFields inherited from interface org.apache.axis2.databinding.utils.Constants
DEFAULT_XSD_NAMESPACE_PREFIX, DEFAULT_XSI_NAMESPACE_PREFIX, INNER_ARRAY_COMPLEX_TYPE_NAME, NIL, OM_ATTRIBUTE_KEY, OM_ELEMENT_KEY, RETURN_WRAPPER, TRUE, XSD_NAMESPACE, XSI_NAMESPACE, XSI_TYPE_ATTRIBUTEFields 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
ConstructorsConstructorDescriptionADBXMLStreamReaderImpl(QName adbBeansQName, Object[] properties, Object[] attributes) ADBXMLStreamReaderImpl(QName adbBeansQName, Object[] properties, Object[] attributes, org.apache.axis2.description.java2wsdl.TypeTable typeTable, boolean qualified) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamespaceContext(NamespaceContext nsContext) add the namespace contextvoidclose()intgetAttributeLocalName(int i) getAttributeName(int i) getAttributeNamespace(int i) getAttributePrefix(int i) getAttributeType(int i) getAttributeValue(int i) getAttributeValue(String nsUri, String localName) org.apache.axiom.blob.BlobgetBlob()org.apache.axiom.ext.stax.BlobProvidertodo implement the right contract for thisintgetName()intgetNamespacePrefix(int i) getNamespaceURI(int i) getNamespaceURI(String prefix) getProperty(String key) getText()char[]intgetTextCharacters(int i, char[] chars, int i1, int i2) intintbooleanhasName()booleanhasNext()booleanhasText()check the validity of this implementationvoidinit()we need to split out the calling to the populate namespaces seperately since this needs to be done *after* setting the parent namespace context.booleanisAttributeSpecified(int i) booleanisBinary()booleanbooleanbooleanisDone()are we done ?booleanbooleanbooleanbooleanbooleanintnext()By far this should be the most important method in this class this method changes the state of the parserintnextTag()todo implement thisvoidboolean
-
Constructor Details
-
ADBXMLStreamReaderImpl
-
ADBXMLStreamReaderImpl
-
-
Method Details
-
addNamespaceContext
add the namespace context- Specified by:
addNamespaceContextin interfaceADBXMLStreamReader
-
init
public void init()we need to split out the calling to the populate namespaces seperately since this needs to be done *after* setting the parent namespace context. We cannot assume it will happen at construction!- Specified by:
initin interfaceADBXMLStreamReader
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamReader- Parameters:
key-- Throws:
IllegalArgumentException
-
isBinary
public boolean isBinary()- Specified by:
isBinaryin interfaceorg.apache.axiom.ext.stax.BlobReader
-
isOptimized
public boolean isOptimized()- Specified by:
isOptimizedin interfaceorg.apache.axiom.ext.stax.BlobReader
-
isDeferred
public boolean isDeferred()- Specified by:
isDeferredin interfaceorg.apache.axiom.ext.stax.BlobReader
-
getContentID
- Specified by:
getContentIDin interfaceorg.apache.axiom.ext.stax.BlobReader
-
getBlob
- Specified by:
getBlobin interfaceorg.apache.axiom.ext.stax.BlobReader- Throws:
XMLStreamException
-
getBlobProvider
public org.apache.axiom.ext.stax.BlobProvider getBlobProvider()- Specified by:
getBlobProviderin interfaceorg.apache.axiom.ext.stax.BlobReader
-
require
- Specified by:
requirein interfaceXMLStreamReader- Throws:
XMLStreamException
-
getElementText
todo implement the right contract for this- Specified by:
getElementTextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
nextTag
todo implement this- Specified by:
nextTagin interfaceXMLStreamReader- Throws:
XMLStreamException
-
hasNext
- Specified by:
hasNextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
close
- Specified by:
closein interfaceXMLStreamReader- Throws:
XMLStreamException
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
isStartElement
public boolean isStartElement()- Specified by:
isStartElementin interfaceXMLStreamReader
-
isEndElement
public boolean isEndElement()- Specified by:
isEndElementin interfaceXMLStreamReader
-
isCharacters
public boolean isCharacters()- Specified by:
isCharactersin interfaceXMLStreamReader
-
isWhiteSpace
public boolean isWhiteSpace()- Specified by:
isWhiteSpacein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getAttributeCount
public int getAttributeCount()- Specified by:
getAttributeCountin interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeNamein interfaceXMLStreamReader- Parameters:
i-
-
getAttributeNamespace
- Specified by:
getAttributeNamespacein interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalNamein interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefixin interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeTypein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
isAttributeSpecified
public boolean isAttributeSpecified(int i) - Specified by:
isAttributeSpecifiedin interfaceXMLStreamReader
-
getNamespaceCount
public int getNamespaceCount()- Specified by:
getNamespaceCountin interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefixin interfaceXMLStreamReader- Parameters:
i-
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLStreamReader
-
getEventType
public int getEventType()- Specified by:
getEventTypein interfaceXMLStreamReader
-
getText
- Specified by:
getTextin interfaceXMLStreamReader
-
getTextCharacters
public char[] getTextCharacters()- Specified by:
getTextCharactersin interfaceXMLStreamReader
-
getTextCharacters
- Specified by:
getTextCharactersin interfaceXMLStreamReader- Throws:
XMLStreamException
-
getTextStart
public int getTextStart()- Specified by:
getTextStartin interfaceXMLStreamReader
-
getTextLength
public int getTextLength()- Specified by:
getTextLengthin interfaceXMLStreamReader
-
getEncoding
- Specified by:
getEncodingin interfaceXMLStreamReader
-
hasText
public boolean hasText()check the validity of this implementation- Specified by:
hasTextin interfaceXMLStreamReader
-
getLocation
- Specified by:
getLocationin interfaceXMLStreamReader
-
getName
- Specified by:
getNamein interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalNamein interfaceXMLStreamReader
-
hasName
public boolean hasName()- Specified by:
hasNamein interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefixin interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersionin interfaceXMLStreamReader
-
isStandalone
public boolean isStandalone()- Specified by:
isStandalonein interfaceXMLStreamReader
-
standaloneSet
public boolean standaloneSet()- Specified by:
standaloneSetin interfaceXMLStreamReader
-
getCharacterEncodingScheme
- Specified by:
getCharacterEncodingSchemein interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITargetin interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIDatain interfaceXMLStreamReader
-
next
By far this should be the most important method in this class this method changes the state of the parser- Specified by:
nextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
isDone
public boolean isDone()are we done ?- Specified by:
isDonein interfaceADBXMLStreamReader
-