You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/04/04 11:19:18 UTC

svn commit: r391258 [1/2] - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/ adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/databinding/utils/reader/ adb/test/org/apache/axis2/databinding/ adb/test/o...

Author: ajith
Date: Tue Apr  4 02:19:13 2006
New Revision: 391258

URL: http://svn.apache.org/viewcvs?rev=391258&view=rev
Log:
Adding a new implementation for the ADBPullParser. This can efficiently handle the null/empty field requirement.
Codegen has been changed to reflect the change.
1. Added a ADBXMLStreamReader interface
2. Added implementations for the base ADBStreamReader, NameValueArrayStreamReader (name,values)
NameValueArrayStreamReader (name,value[]) and a wrapping reader
3. Changed the StreamWrapper.java to generate an END_DOCUMENT event 
4. Changed other classes to suit the change

The most important change in this implementation is that the starting event for the pullparser provided is START_ELEMENT rather than START_DOCUMENT. This makes the reader required to be wrapped in a StreamWrapper when it is needed by the StaxOMBuilder.
However the amount of test cases for ADB does not seem to suffice to completely test the functionality (round trip). The next step should be to implement some roundtrip test cases.


Added:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java
      - copied, changed from r390389, webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/NullablePullParser.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
Removed:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/NullablePullParser.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java
Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/ADBSOAPModelBuilder.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ClientInfo.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/CreateAccountRequest.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/StreamWrapper.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/types/RequestSecurityTokenResponseType.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/types/RequestSecurityTokenType.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/types/RequestedSecurityTokenType.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/ADBSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/ADBSOAPModelBuilder.java?rev=391258&r1=391257&r2=391258&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/ADBSOAPModelBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/ADBSOAPModelBuilder.java Tue Apr  4 02:19:13 2006
@@ -4,6 +4,7 @@
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.util.StreamWrapper;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
@@ -13,7 +14,11 @@
  */
 public class ADBSOAPModelBuilder extends StAXSOAPModelBuilder {
     public ADBSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory) {
-        super(new Envelope(parser).getPullParser(new QName(factory.getSoapVersionURI(), SOAPConstants.SOAPENVELOPE_LOCAL_NAME, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX)),
+        super(new Envelope(parser).
+                getPullParser(
+                new QName(factory.getSoapVersionURI(),
+                        SOAPConstants.SOAPENVELOPE_LOCAL_NAME,
+                        SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX)),
                 factory,
                 factory.getSoapVersionURI());
     }
@@ -36,7 +41,9 @@
             elementList.add(new Header());
             elementList.add(new QName(qName.getNamespaceURI(), "Body", SOAPConstants.BODY_NAMESPACE_PREFIX));
             elementList.add(body);
-            return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName, elementList.toArray(), null);
+            return
+                    new StreamWrapper(new org.apache.axis2.databinding.utils.reader.
+                    ADBXMLStreamReaderImpl(qName, elementList.toArray(), null));
         }
     }
     
@@ -56,7 +63,7 @@
             java.util.ArrayList elementList = new java.util.ArrayList();
             elementList.add(qName);
             elementList.add(child);
-            return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName, elementList.toArray(), null);
+            return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), null);
         }
     }
 
@@ -64,7 +71,7 @@
             implements org.apache.axis2.databinding.ADBBean {
         public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) {
             java.util.ArrayList elementList = new java.util.ArrayList();
-            return org.apache.axis2.databinding.utils.ADBPullParser.createPullParser(qName, elementList.toArray(), null);
+            return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), null);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=391258&r1=391257&r2=391258&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Tue Apr  4 02:19:13 2006
@@ -23,8 +23,11 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.util.StreamWrapper;
 import org.apache.axis2.databinding.typemapping.SimpleTypeMapper;
+import org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl;
 import org.codehaus.jam.JClass;
 import org.codehaus.jam.JProperty;
 import org.codehaus.jam.JamClassIterator;
@@ -34,6 +37,9 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLOutputFactory;
 import java.beans.BeanInfo;
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
@@ -43,6 +49,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Locale;
+import java.io.ByteArrayOutputStream;
 
 
 public class BeanUtil {
@@ -142,7 +149,7 @@
                     object.add(value);
                 }
             }
-            return ADBPullParser.createPullParser(beanName, object.toArray(), null);
+            return new ADBXMLStreamReaderImpl(beanName, object.toArray(), null);
         } catch (Exception e) {
             return null;
         }
@@ -498,10 +505,30 @@
             argCount ++;
         }
 
-        XMLStreamReader xr = ADBPullParser.createPullParser(opName, objects.toArray(), null);
+        XMLStreamReader xr = new ADBXMLStreamReaderImpl(opName, objects.toArray(), null);
+
+        StreamWrapper parser = new StreamWrapper(xr);
+//      /////////////////////////////////////////////////////////////////////////
+//      /////////////////////////////////////////////////////////////////////////
+//        StreamWrapper parser = null;
+//        try {
+//
+//            StreamingOMSerializer ser = new StreamingOMSerializer();
+//            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+//            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
+//            ser.serialize(
+//                    new StreamWrapper(parser),
+//                    writer);
+//            writer.flush();
+//        } catch (XMLStreamException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        }
+//
+////       ////////////////////////////////////
         StAXOMBuilder stAXOMBuilder =
                 OMXMLBuilderFactory.createStAXOMBuilder(
-                        OMAbstractFactory.getSOAP11Factory(), xr);
+                        OMAbstractFactory.getSOAP11Factory(), parser);
+        stAXOMBuilder.setDoDebug(true);
         return stAXOMBuilder.getDocumentElement();
     }
 

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java?rev=391258&r1=391257&r2=391258&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java Tue Apr  4 02:19:13 2006
@@ -1,4 +1,6 @@
 package org.apache.axis2.databinding.utils;
+
+import org.apache.axis2.databinding.utils.reader.OMAttribKey;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -18,5 +20,7 @@
 public interface Constants {
 
     static  String NIL="nil";
-    static  String TRUE="true"; 
+    static  String TRUE="true";
+
+    static Object OM_ATTRIBUTE_KEY = new OMAttribKey();
 }

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,134 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import javax.xml.namespace.NamespaceContext;
+import java.util.Iterator;
+import java.util.Stack;
+import java.util.ArrayList;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class ADBNamespaceContext implements NamespaceContext {
+
+    private NamespaceContext parentNsContext;
+
+    public NamespaceContext getParentNsContext() {
+        return parentNsContext;
+    }
+
+    public void setParentNsContext(NamespaceContext parentNsContext) {
+        this.parentNsContext = parentNsContext;
+    }
+
+    //Keep two arraylists for the prefixes and namespaces. They should be in sync
+    //since the index of the entry will be used to relate them
+    //use the minimum initial capacity to let things handle memory better
+
+    private Stack prefixStack = new Stack();
+    private Stack uriStack = new Stack();
+
+    /**
+     * Register a namespace in this context
+     * @param prefix
+     * @param uri
+     */
+    public void pushNamespace(String prefix,String uri){
+        prefixStack.push(prefix);
+        uriStack.push(uri);
+
+    }
+
+    /**
+     * Pop a namespace
+     */
+    public void popNamespace(){
+        prefixStack.pop();
+        uriStack.pop();
+    }
+    public String getNamespaceURI(String prefix) {
+        //do the corrections as per the javadoc
+        if (prefixStack.contains(prefix)){
+            int index = prefixStack.indexOf(prefix);
+            return (String)uriStack.get(index);
+        }
+        if (parentNsContext!=null){
+            return parentNsContext.getPrefix(prefix);
+        }
+        return null;
+    }
+
+    public String getPrefix(String uri) {
+        //do the corrections as per the javadoc
+        if (uriStack.contains(uri)){
+            int index = uriStack.indexOf(uri);
+            return (String)prefixStack.get(index);
+        }
+
+        if (parentNsContext!=null){
+            return parentNsContext.getPrefix(uri);
+        }
+        return null;
+    }
+
+    public Iterator getPrefixes(String uri) {
+        //create an arraylist that contains the relevant prefixes
+        String[] uris = (String[])uriStack.toArray(new String[uriStack.size()]);
+        ArrayList tempList = new ArrayList();
+        for (int i = 0; i < uris.length; i++) {
+            if (uris[i].equals(uri)){
+                tempList.add(prefixStack.get(i));
+                //we assume that array conversion preserves the order
+            }
+        }
+        //by now all the relevant prefixes are collected
+        //make a new iterator and provide a wrapper iterator to
+        //obey the contract on the API
+        return new WrappingIterator(tempList.iterator());
+    }
+
+
+    private class WrappingIterator implements Iterator{
+
+        private Iterator containedIterator = null;
+
+        public WrappingIterator(Iterator containedIterator) {
+            this.containedIterator = containedIterator;
+        }
+
+        public Iterator getContainedIterator() {
+            return containedIterator;
+        }
+
+        public void setContainedIterator(Iterator containedIterator) {
+            this.containedIterator = containedIterator;
+        }
+
+        /**
+         * As per the contract on the API of Namespace context
+         * the returned iterator should be immutable
+         */
+        public void remove() {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasNext() {
+            return containedIterator.hasNext();
+        }
+
+        public Object next() {
+            return containedIterator.next();
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,46 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.namespace.NamespaceContext;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public interface ADBXMLStreamReader extends XMLStreamReader {
+
+    // this will help to handle Text within the current element.
+    // user should pass the element text to the property list as this
+    // ELEMENT_TEXT as the key. This key deliberately has a space in it
+    // so that it is not a valid XML name
+    static final String ELEMENT_TEXT = "Element Text";
+
+    /**
+     * Extra method to query the state of the pullparser
+     * @return
+     */
+     boolean isDone();
+
+    /**
+     * add the parent namespace context to this parser
+     */
+     void addNamespaceContext(NamespaceContext nsContext);
+
+    /**
+     * Initiate the parser - this will do whatever the needed
+     * tasks to initiate the parser and must be called before
+     * attempting any specific parsing using this parser
+     */
+     void init();
+}

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,933 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.databinding.ADBBean;
+import org.apache.axis2.databinding.utils.BeanUtil;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * 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. null - OMElement[] value
+ * <p/>
+ * 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 three states and delegates
+ * things down to the child parsers whenever possible
+ * <p/>
+ * the possible inputs for this class
+ */
+public class ADBXMLStreamReaderImpl implements ADBXMLStreamReader {
+
+    private Object[] properties;
+    private Object[] attributes;
+    private QName elementQName;
+    //we always create a new namespace context
+    private ADBNamespaceContext namespaceContext = new ADBNamespaceContext();
+
+    private Map declaredNamespaceMap = new HashMap();
+
+    //states for this pullparser - it can only have three states
+    private static final int START_ELEMENT_STATE = 0;
+    private static final int END_ELEMENT_STATE = 1;
+    private static final int DELEGATED_STATE = 2;
+    private static final int TEXT_STATE = 3;
+
+    //integer field that keeps the state of this
+    //parser.
+    private int state = START_ELEMENT_STATE;
+
+    //reference to the child reader
+    private ADBXMLStreamReader childReader;
+
+    //current property index
+    //initialized at zero
+    private int currentPropertyIndex = 0;
+
+
+    /*
+     * we need to pass in a namespace context since when delegated, we've no
+    * idea of the current namespace context. So it needs to be passed on
+    * here!
+    */
+    public ADBXMLStreamReaderImpl(QName adbBeansQName,
+                                  Object[] properties,
+                                  Object[] attributes) {
+        //validate the lengths, since both the arrays are supposed
+        //to have
+        this.properties = properties;
+        this.elementQName = adbBeansQName;
+        this.attributes = attributes;
+
+
+    }
+
+    /**
+     * add the namespace context
+     */
+
+    public void addNamespaceContext(NamespaceContext nsContext) {
+        // register the namespace context passed in to this
+        this.namespaceContext.setParentNsContext(nsContext);
+
+
+    }
+
+    /**
+     * 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!
+     */
+    public void init() {
+        // here we have an extra issue to attend to. we need to look at the
+        // prefixes and uris (the combination) and populate a hashmap of
+        // namespaces. The hashmap of namespaces will be used to serve the
+        // namespace context
+
+        populateNamespaceContext();
+    }
+
+    public Object getProperty(String string) throws IllegalArgumentException {
+        if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+            return null;
+        }
+        return childReader.getProperty(string);
+    }
+
+    public int next() throws XMLStreamException {
+        return updateStatus();
+    }
+
+    public void require(int i, String string, String string1)
+            throws XMLStreamException {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * todo implement the right contract for this
+     *
+     * @return
+     * @throws XMLStreamException
+     */
+    public String getElementText() throws XMLStreamException {
+        if (state == DELEGATED_STATE) {
+            return childReader.getElementText();
+        } else {
+            return null;
+        }
+
+    }
+
+    /**
+     * todo implement this
+     *
+     * @return
+     * @throws XMLStreamException
+     */
+    public int nextTag() throws XMLStreamException {
+        return 0;
+    }
+
+    /**
+     * @return
+     * @throws XMLStreamException
+     */
+    public boolean hasNext() throws XMLStreamException {
+        if (state == DELEGATED_STATE) {
+            if (childReader.isDone()){
+                //the child reader is done. We shouldn't be getting the
+                //hasnext result from the child pullparser then
+                return true;
+            }else{
+                return childReader.hasNext();
+            }
+        } else  {
+            return (state == START_ELEMENT_STATE
+                    || state == TEXT_STATE);
+
+
+        }
+    }
+
+    public void close() throws XMLStreamException {
+        //do nothing here - we have no resources to free
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return namespaceContext.getNamespaceURI(prefix);
+    }
+
+    public boolean isStartElement() {
+        if (state == START_ELEMENT_STATE) {
+            return true;
+        } else if (state == END_ELEMENT_STATE) {
+            return false;
+        }
+        return childReader.isStartElement();
+    }
+
+    public boolean isEndElement() {
+        if (state == START_ELEMENT_STATE) {
+            return false;
+        } else if (state == END_ELEMENT_STATE) {
+            return true;
+        }
+        return childReader.isEndElement();
+    }
+
+    public boolean isCharacters() {
+        if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+            return false;
+        }
+        return childReader.isCharacters();
+    }
+
+    public boolean isWhiteSpace() {
+        if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+            return false;
+        }
+        return childReader.isWhiteSpace();
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+    ///  attribute handling
+    ///////////////////////////////////////////////////////////////////////////
+
+    public String getAttributeValue(String nsUri, String localName) {
+
+        int attribCount = getAttributeCount();
+        String returnValue = null;
+        QName attribQualifiedName;
+        for (int i = 0; i < attribCount; i++) {
+            attribQualifiedName = getAttributeName(i);
+            if (nsUri == null) {
+                if (localName.equals(attribQualifiedName.getLocalPart())) {
+                    returnValue = getAttributeValue(i);
+                    break;
+                }
+            } else {
+                if (localName.equals(attribQualifiedName.getLocalPart())
+                        && nsUri.equals(attribQualifiedName.getNamespaceURI())) {
+                    returnValue = getAttributeValue(i);
+                    break;
+                }
+            }
+
+        }
+
+
+        return returnValue;
+    }
+
+    public int getAttributeCount() {
+        return (state == DELEGATED_STATE) ?
+                childReader.getAttributeCount() :
+                ((attributes != null)&&(state==START_ELEMENT_STATE) ? attributes.length / 2 : 0);
+    }
+
+    /**
+     * @param i
+     * @return
+     */
+    public QName getAttributeName(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getAttributeName(i);
+        } else if (state==START_ELEMENT_STATE) {
+            if (attributes == null) {
+                return null;
+            } else {
+                if ((i >= (attributes.length / 2)) || i < 0) { //out of range
+                    return null;
+                } else {
+                    //get the attribute pointer
+                    Object attribPointer = attributes[i * 2];
+                    //case one - attrib name is null
+                    //this should be the pointer to the OMAttribute then
+                    if (attribPointer == null) {
+                        Object omAttribObj = attributes[(i * 2) + 1];
+                        if (omAttribObj == null ||
+                                !(omAttribObj instanceof OMAttribute)) {
+                            // wrong object set to have in the attrib array -
+                            // this should have been detected by now but just be
+                            // sure
+                            throw new UnsupportedOperationException();
+                        }
+                        OMAttribute att = (OMAttribute) omAttribObj;
+                        return att.getQName();
+                    } else if (attribPointer instanceof OMAttribKey){
+                        Object omAttribObj = attributes[(i * 2) + 1];
+                        if (omAttribObj == null ||
+                                !(omAttribObj instanceof OMAttribute)) {
+                            // wrong object set to have in the attrib array -
+                            // this should have been detected by now but just be
+                            // sure
+                            throw new UnsupportedOperationException();
+                        }
+                        OMAttribute att = (OMAttribute) omAttribObj;
+                        return att.getQName();
+                        //case two - attrib name is a plain string
+                    } else if (attribPointer instanceof String) {
+                        return new QName((String) attribPointer);
+                    } else if (attribPointer instanceof QName) {
+                        return (QName) attribPointer;
+                    } else {
+                        return null;
+                    }
+                }
+            }
+        }else{
+            throw new IllegalStateException();//as per the api contract
+        }
+
+    }
+
+    public String getAttributeNamespace(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getAttributeNamespace(i);
+        } else if (state==START_ELEMENT_STATE) {
+            QName name = getAttributeName(i);
+            if (name == null) {
+                return null;
+            } else {
+                return name.getNamespaceURI();
+            }
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributeLocalName(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getAttributeLocalName(i);
+        } else if (state==START_ELEMENT_STATE) {
+            QName name = getAttributeName(i);
+            if (name == null) {
+                return null;
+            } else {
+                return name.getLocalPart();
+            }
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributePrefix(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getAttributePrefix(i);
+        } else if (state==START_ELEMENT_STATE) {
+            QName name = getAttributeName(i);
+            if (name == null) {
+                return null;
+            } else {
+                return name.getPrefix();
+            }
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributeType(int i) {
+        return null;  //not supported
+    }
+
+    public String getAttributeValue(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getAttributeValue(i);
+        } else if (state ==START_ELEMENT_STATE){
+            if (attributes == null) {
+                return null;
+            } else {
+                if ((i >= (attributes.length / 2)) || i < 0) { //out of range
+                    return null;
+                } else {
+                    //get the attribute pointer
+                    Object attribPointer = attributes[i * 2];
+                    Object omAttribObj = attributes[(i * 2) + 1];
+                    //case one - attrib name is null
+                    //this should be the pointer to the OMAttribute then
+                    if (attribPointer == null) {
+
+                        if (omAttribObj == null ||
+                                !(omAttribObj instanceof OMAttribute)) {
+                            // wrong object set to have in the attrib array -
+                            // this should have been detected by now but just be
+                            // sure
+                            throw new UnsupportedOperationException();
+                        }
+                        OMAttribute att = (OMAttribute) omAttribObj;
+                        return att.getAttributeValue();
+                    } else if (attribPointer instanceof OMAttribKey){
+                        if (omAttribObj == null ||
+                                !(omAttribObj instanceof OMAttribute)) {
+                            // wrong object set to have in the attrib array -
+                            // this should have been detected by now but just be
+                            // sure
+                            throw new UnsupportedOperationException();
+                        }
+                        OMAttribute att = (OMAttribute) omAttribObj;
+                        return att.getAttributeValue();
+                        //case two - attrib name is a plain string
+                    } else if (attribPointer instanceof String) {
+                        return (String) omAttribObj;
+                    } else if (attribPointer instanceof QName) {
+                        return (String) omAttribObj;
+                    } else {
+                        return null;
+                    }
+                }
+            }
+        }else{
+            throw new IllegalStateException();
+        }
+
+    }
+
+    public boolean isAttributeSpecified(int i) {
+        return false;  //not supported
+    }
+
+///////////////////////////////////////////////////////////////////////////
+//////////////  end of attribute handling
+///////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////////
+//////////////   namespace handling
+////////////////////////////////////////////////////////////////////////////
+
+    public int getNamespaceCount() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getNamespaceCount();
+        } else {
+            return declaredNamespaceMap.size();
+        }
+    }
+
+    /**
+     * @param i
+     * @return
+     */
+    public String getNamespacePrefix(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getNamespacePrefix(i);
+        } else if (state!=TEXT_STATE) {
+            //order the prefixes
+            String[] prefixes = makePrefixArray();
+            if ((i >= prefixes.length) || (i < 0)) {
+                return null;
+            } else {
+                return prefixes[i];
+            }
+
+        }else{
+            throw new IllegalStateException();
+        }
+
+    }
+
+    /**
+     * Get the prefix list from the hastable and take that into an array
+     *
+     * @return
+     */
+    private String[] makePrefixArray() {
+        String[] prefixes =
+                (String[]) declaredNamespaceMap.keySet().
+                        toArray(new String[declaredNamespaceMap.size()]);
+        Arrays.sort(prefixes);
+        return prefixes;
+    }
+
+    public String getNamespaceURI(int i) {
+        if (state == DELEGATED_STATE) {
+            return childReader.getNamespaceURI(i);
+        } else if (state!=TEXT_STATE) {
+            String namespacePrefix = getNamespacePrefix(i);
+            return namespacePrefix == null ? null :
+                    (String) declaredNamespaceMap.get(namespacePrefix);
+        }else{
+            throw new IllegalStateException();
+        }
+
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getNamespaceContext();
+        } else {
+            return namespaceContext;
+        }
+
+
+    }
+
+///////////////////////////////////////////////////////////////////////////
+/////////  end of namespace handling
+///////////////////////////////////////////////////////////////////////////
+
+    public int getEventType() {
+        if (state == START_ELEMENT_STATE) {
+            return START_ELEMENT;
+        } else if (state == END_ELEMENT_STATE) {
+            return END_ELEMENT;
+        } else { // this is the delegated state
+            return childReader.getEventType();
+        }
+
+    }
+
+    public String getText() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getText();
+        } else if (state==TEXT_STATE) {
+            return (String)properties[currentPropertyIndex-1];
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public char[] getTextCharacters() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getTextCharacters();
+        }else if (state==TEXT_STATE) {
+            return properties[currentPropertyIndex-1]==null?new char[0]:
+                    ((String)properties[currentPropertyIndex-1]).toCharArray();
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextCharacters(int i, char[] chars, int i1, int i2)
+            throws XMLStreamException {
+        if (state == DELEGATED_STATE) {
+            return childReader.getTextCharacters(i, chars, i1, i2);
+        }else if (state==TEXT_STATE) {
+            //todo  - implement this
+            return 0;
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextStart() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getTextStart();
+        } else if (state==TEXT_STATE) {
+            return 0;//assume text always starts at 0
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextLength() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getTextLength();
+        } else if (state==TEXT_STATE) {
+            return 0;//assume text always starts at 0
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getEncoding() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getEncoding();
+        } else {
+            //we've no idea what the encoding is going to be in this case
+            //perhaps we ought to return some constant here, which the user might
+            //have access to change!
+            return null;
+        }
+    }
+
+    /**
+     * check the validity of this implementation
+     *
+     * @return
+     */
+    public boolean hasText() {
+        if (state == DELEGATED_STATE) {
+            return childReader.hasText();
+        } else if (state==TEXT_STATE){
+            return true;
+        }else{
+            return false;
+        }
+
+    }
+
+    /**
+     * @return
+     */
+    public Location getLocation() {
+        //return a default location
+        return new Location(){
+            public int getLineNumber() {
+                return 0;
+            }
+
+            public int getColumnNumber() {
+                return 0;
+            }
+
+            public int getCharacterOffset() {
+                return 0;
+            }
+
+            public String getPublicId() {
+                return null;
+            }
+
+            public String getSystemId() {
+                return null;
+            }
+        };
+    }
+
+    public QName getName() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getName();
+        } else if (state!=TEXT_STATE) {
+            return elementQName;
+        }else{
+            throw new IllegalStateException();
+        }
+
+    }
+
+    public String getLocalName() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getLocalName();
+        } else if (state!=TEXT_STATE) {
+            return elementQName.getLocalPart();
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public boolean hasName() {
+        //since this parser always has a name, the hasname
+        //has to return true if we are still navigating this element
+        //if not we should ask the child reader for it.
+        if (state == DELEGATED_STATE) {
+            return childReader.hasName();
+        } else if (state!=TEXT_STATE) {
+            return true;
+        }else{
+            return false;
+        }
+    }
+
+    public String getNamespaceURI() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getNamespaceURI();
+        } else if (state==TEXT_STATE) {
+            return null;
+        }else{
+            return elementQName.getNamespaceURI();
+        }
+    }
+
+    public String getPrefix() {
+        if (state == DELEGATED_STATE) {
+            return childReader.getPrefix();
+        } else if (state==TEXT_STATE) {
+            return null;
+        }else{
+            return elementQName.getPrefix();
+        }
+    }
+
+    public String getVersion() {
+        return null;
+    }
+
+    public boolean isStandalone() {
+        return true;
+    }
+
+    public boolean standaloneSet() {
+        return true;
+    }
+
+    public String getCharacterEncodingScheme() {
+        return null;   //todo - should we return something for this ?
+    }
+
+    public String getPITarget() {
+        throw new UnsupportedOperationException("Yet to be implemented !!");
+    }
+
+    public String getPIData() {
+        throw new UnsupportedOperationException("Yet to be implemented !!");
+    }
+
+///////////////////////////////////////////////////////////////////////////
+/// Other utility methods
+//////////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Populates a namespace context
+     */
+    private void populateNamespaceContext() {
+
+        //first add the current element namespace to the namespace context
+        //declare it if not found
+        addToNsMap(elementQName.getPrefix(), elementQName.getNamespaceURI());
+
+        //traverse through the attributes and populate the namespace context
+        //the attrib list can be of many combinations
+        // the valid combinations are
+        // String - String
+        // QName - QName
+        // null - OMAttribute
+
+        if (attributes != null) {
+            for (int i = 0; i < attributes.length; i = i + 2) { //jump in two
+                Object attribName = attributes[i];
+                if (attribName == null) {
+                    //this should be the OMAttrib case!
+                    OMAttribute OMAttrib = (OMAttribute) attributes[i + 1];
+                    OMNamespace namespace = OMAttrib.getNamespace();
+                    if (namespace != null) {
+                        addToNsMap(namespace.getPrefix(),
+                                namespace.getName());
+                    }
+                } else if (attribName instanceof OMAttribKey) {
+                    //this is definitely the OMAttribute case
+                    OMAttribute OMAttrib = (OMAttribute) attributes[i + 1];
+                    OMNamespace namespace = OMAttrib.getNamespace();
+                    if (namespace != null) {
+                        addToNsMap(namespace.getPrefix(),
+                                namespace.getName());
+                    }
+                } else if (attribName instanceof String) {
+                    //ignore this case - Nothing to do
+                } else if (attribName instanceof QName) {
+                    QName attribQName = ((QName) attribName);
+                    addToNsMap(attribQName.getPrefix(),
+                            attribQName.getNamespaceURI());
+
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * @param prefix
+     * @param uri
+     */
+    private void addToNsMap(String prefix, String uri) {
+        if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
+            namespaceContext.pushNamespace(prefix, uri);
+            declaredNamespaceMap.put(prefix, uri);
+        }
+    }
+
+    /**
+     * By far this should be the most important method in this class
+     * this method changes the state of the parser according to the
+     * change in the
+     */
+    private int updateStatus() throws XMLStreamException {
+        int returnEvent = -1; //invalid state is the default state
+        switch (state) {
+            case START_ELEMENT_STATE:
+                //current element is start element. We should be looking at the
+                //property list and making a pullparser for the property value
+                if (properties == null || properties.length == 0) {
+                    //no properties - move to the end element state straightaway
+                    state = END_ELEMENT_STATE;
+                    returnEvent = END_ELEMENT;
+                } else {
+                    //there are properties. now we should delegate this task to a
+                    //child reader depending on the property type
+                    returnEvent = processProperties();
+
+
+                }
+                break;
+            case END_ELEMENT_STATE:
+                //we've reached the end element already. If the user tries to push
+                // further ahead then it is an exception
+                throw new XMLStreamException(
+                        "Trying to go beyond the end of the pullparser");
+
+
+            case DELEGATED_STATE:
+                if (childReader.isDone()) {
+                    //we've reached the end!
+                    if (currentPropertyIndex > (properties.length - 1)) {
+                        state = END_ELEMENT_STATE;
+                        returnEvent = END_ELEMENT;
+                    } else {
+                        returnEvent = processProperties();
+                    }
+                } else {
+                    returnEvent = childReader.next();
+                }
+                break;
+
+            case TEXT_STATE:
+                // if there are any more event we should be delegating to
+                // processProperties. if not we just return an end element
+                if (currentPropertyIndex > (properties.length - 1)) {
+                    state = END_ELEMENT_STATE;
+                    returnEvent = END_ELEMENT;
+                } else {
+                    returnEvent = processProperties();
+                }
+                break;
+        }
+        return returnEvent;
+    }
+
+    /**
+     * A convenient method to reuse the properties
+     *
+     * @return event to be thrown
+     * @throws XMLStreamException
+     */
+    private int processProperties() throws XMLStreamException {
+        //move to the next property depending on the current property
+        //index
+        Object propPointer = properties[currentPropertyIndex];
+        QName propertyQName=null;
+        boolean textFound = false;
+        if (propPointer == null) {
+            throw new XMLStreamException("property key cannot be null!");
+        } else if (propPointer instanceof String) {
+            // propPointer being a String has a special case
+            // that is it can be a the special constant ELEMENT_TEXT that
+            // says this text event
+            if (ELEMENT_TEXT.equals(propPointer)){
+                textFound = true;
+            }else{
+                propertyQName = new QName((String) propPointer);
+            }
+        } else if (propPointer instanceof QName) {
+            propertyQName = (QName) propPointer;
+        } else {
+            //oops - we've no idea what kind of key this is
+            throw new XMLStreamException(
+                    "unidentified property key!!!" + propPointer);
+        }
+
+        //ok! we got the key. Now look at the value
+        Object propertyValue = properties[currentPropertyIndex + 1];
+        //cater for the special case now
+        if (textFound){
+            //no delegation here - make the parser null and immediately
+            //return with the event characters
+            childReader = null;
+            state = TEXT_STATE;
+            currentPropertyIndex = currentPropertyIndex + 2;
+            return CHARACTERS;
+        }else if (propertyValue == null) {
+            //if the value is null we delegate the work to a nullable
+            // parser
+            childReader = new NullXMLStreamReader(propertyQName);
+        } else if (propertyValue instanceof String) {
+            //strings are handled by the NameValuePairStreamReader
+            childReader =
+                    new NameValuePairStreamReader(propertyQName,
+                            (String)propertyValue);
+            childReader.addNamespaceContext(this.namespaceContext);
+            childReader.init();
+        } else if (propertyValue instanceof String[]) {
+            //string[] are handled by the  NameValueArrayStreamReader
+            //if the array is empty - skip it
+            if (((String[])propertyValue).length==0){
+                 //advance the index
+                currentPropertyIndex = currentPropertyIndex + 2;
+                return processProperties();
+            }else{
+                childReader =
+                        new NameValueArrayStreamReader(propertyQName,
+                                (String[])propertyValue);
+                childReader.addNamespaceContext(this.namespaceContext);
+                childReader.init();
+            }
+
+        } else if (propertyValue instanceof ADBBean) {
+            //ADBbean has it's own method to get a reader
+            XMLStreamReader reader = ((ADBBean) propertyValue).
+                    getPullParser(propertyQName);
+            // we know for sure that this is an ADB XMLStreamreader.
+            // However we need to make sure that it is compatible
+            if (reader instanceof ADBXMLStreamReader) {
+                childReader = (ADBXMLStreamReader) reader;
+                childReader.addNamespaceContext(this.namespaceContext);
+                childReader.init();
+            } else {
+                //wrap it to make compatible
+                childReader = new WrappingXMLStreamReader(
+                        reader);
+            }
+        } else if (propertyValue instanceof OMElement) {
+            //OMElements do not provide the kind of parser we need
+            //there is no other option than wrapping
+            childReader = new WrappingXMLStreamReader(
+                    ((OMElement) propertyValue).getXMLStreamReader());
+            //we cannot register the namespace context here!!
+
+        } else {
+            //all special possiblilities has been tried! Let's treat
+            //the thing as a bean and try generating events from it
+            childReader = new WrappingXMLStreamReader
+                    (BeanUtil.getPullParser(propertyValue,
+                            propertyQName));
+            //we cannot register the namespace context here
+        }
+
+        //set the state here
+        state = DELEGATED_STATE;
+        //we are done with the delegation
+        //increment the property index
+        currentPropertyIndex = currentPropertyIndex + 2;
+        return childReader.getEventType();
+    }
+
+    /**
+     * are we done ?
+     *
+     * @return
+     */
+    public boolean isDone() {
+        return (state == END_ELEMENT_STATE);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,416 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.Location;
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class NameValueArrayStreamReader implements ADBXMLStreamReader {
+
+    private static final int START_ELEMENT_STATE = 0;
+    private static final int TEXT_STATE = 1;
+    private static final int END_ELEMENT_STATE = 2;
+    private static final int FINAL_END_ELEMENT_STATE = 3;
+    private static final int START_ELEMENT_STATE_WITH_NULL = 4;
+
+    private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
+    private static final String NIL_VALUE_TRUE = "true";
+
+
+    private ADBNamespaceContext namespaceContext =
+            new ADBNamespaceContext();
+    //the index of the array
+    private int arrayIndex = 0;
+
+    private QName name;
+    private String[] values;
+
+    //start element is the default state
+    private int state = START_ELEMENT_STATE;
+
+
+    public NameValueArrayStreamReader(QName name, String[] values) {
+        this.name = name;
+        this.values = values;
+    }
+
+    public void addNamespaceContext(NamespaceContext nsContext) {
+        this.namespaceContext.setParentNsContext(nsContext);
+    }
+
+    public void init() {
+        //todo what if the Qname namespace has not been declared
+    }
+
+    public Object getProperty(String string) throws IllegalArgumentException {
+        return null;
+    }
+
+    /**
+     * @return
+     * @throws XMLStreamException
+     */
+    public int next() throws XMLStreamException {
+        switch (state) {
+            case START_ELEMENT_STATE:
+                if (values.length>0){
+                    state = TEXT_STATE;
+                    return CHARACTERS;
+                }else{
+                    state = FINAL_END_ELEMENT_STATE;
+                    return END_ELEMENT;
+                }
+
+            case START_ELEMENT_STATE_WITH_NULL:
+                if (arrayIndex == (values.length - 1)) {
+                    state = FINAL_END_ELEMENT_STATE;
+                } else {
+                    state = END_ELEMENT_STATE;
+                }
+                return END_ELEMENT;
+            case FINAL_END_ELEMENT_STATE:
+                //oops, not supposed to happen!
+                throw new XMLStreamException("end already reached!");
+            case END_ELEMENT_STATE:
+                //we've to have more values since this is not the
+                //last value
+                //increment the counter
+                arrayIndex++;
+                if (values[arrayIndex] == null) {
+                    state = START_ELEMENT_STATE_WITH_NULL;
+                } else {
+                    state = START_ELEMENT_STATE;
+                }
+                return START_ELEMENT;
+            case TEXT_STATE:
+                if (arrayIndex == (values.length - 1)) {
+                    state = FINAL_END_ELEMENT_STATE;
+                    return END_ELEMENT;
+                } else {
+                    state = END_ELEMENT_STATE;
+                    return END_ELEMENT;
+                }
+
+            default:
+                throw new XMLStreamException("unknown event type!");
+        }
+    }
+
+    public void require(int i, String string, String string1) throws XMLStreamException {
+        //nothing done here
+    }
+
+    public String getElementText() throws XMLStreamException {
+        return null; //not implemented
+    }
+
+    public int nextTag() throws XMLStreamException {
+        return 0; //not implemented
+    }
+
+
+    public String getAttributeValue(String string, String string1) {
+        if (state == TEXT_STATE) {
+            //todo something
+            return null;
+        } else {
+            return null;
+        }
+
+    }
+
+    public int getAttributeCount() {
+        if (state == START_ELEMENT_STATE_WITH_NULL) return 1;
+        if (state == START_ELEMENT_STATE) {
+            return 0;
+        } else {
+            throw new IllegalStateException();
+        }
+
+    }
+
+    public QName getAttributeName(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+            return NIL_QNAME;
+        if (state == START_ELEMENT_STATE) {
+            return null;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributeNamespace(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL  && i == 0)
+            return NIL_QNAME.getNamespaceURI();
+        if (state == START_ELEMENT_STATE) {
+            return null;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributeLocalName(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+            return NIL_QNAME.getLocalPart();
+        if (state == START_ELEMENT_STATE) {
+            return null;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributePrefix(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+            return NIL_QNAME.getPrefix();
+        if (state == START_ELEMENT_STATE) {
+            return null;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public String getAttributeType(int i) {
+        return null;  //not implemented
+    }
+
+    public String getAttributeValue(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+            return NIL_VALUE_TRUE;
+        if (state == START_ELEMENT_STATE) {
+            return null;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public boolean isAttributeSpecified(int i) {
+        return false; //not supported
+    }
+
+    public int getNamespaceCount() {
+        if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent())
+            return 1;
+        else
+            return 0;
+
+    }
+
+    public String getNamespacePrefix(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL
+                && isXsiNamespacePresent() && i==0)
+            return NIL_QNAME.getPrefix();
+        else
+            return null;
+    }
+
+    public String getNamespaceURI(int i) {
+        if (state == START_ELEMENT_STATE_WITH_NULL
+                && isXsiNamespacePresent() && i==0)
+            return NIL_QNAME.getNamespaceURI();
+        else
+            return null;
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        return this.namespaceContext;
+    }
+
+    public boolean isDone() {
+        return (state == FINAL_END_ELEMENT_STATE);
+    }
+
+    public int getEventType() {
+        switch (state) {
+            case START_ELEMENT_STATE:
+                return START_ELEMENT;
+            case END_ELEMENT_STATE:
+                return END_ELEMENT;
+            case TEXT_STATE:
+                return CHARACTERS;
+            case FINAL_END_ELEMENT_STATE:
+                return END_ELEMENT;
+            default:
+                throw new UnsupportedOperationException();
+                //we've no idea what this is!!!!!
+        }
+
+    }
+
+    public String getText() {
+        if (state == TEXT_STATE) {
+            return values[arrayIndex];
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public char[] getTextCharacters() {
+        if (state == TEXT_STATE) {
+            return values[arrayIndex].toCharArray();
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
+        //not implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public int getTextStart() {
+        if (state == TEXT_STATE) {
+            return 0;
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextLength() {
+        if (state == TEXT_STATE) {
+            return values[arrayIndex].length();
+        } else {
+            throw new IllegalStateException();
+        }
+
+    }
+
+    public String getEncoding() {
+        return null;
+    }
+
+    public boolean hasText() {
+        return (state == TEXT_STATE);
+    }
+
+    public Location getLocation() {
+        return null;  //not supported
+    }
+
+    public QName getName() {
+        if (state != TEXT_STATE) {
+            return name;
+        } else {
+            return null;
+        }
+    }
+
+    public String getLocalName() {
+        if (state != TEXT_STATE) {
+            return name.getLocalPart();
+        } else {
+            return null;
+        }
+    }
+
+    public boolean hasName() {
+        return (state != TEXT_STATE);
+
+    }
+
+    public String getNamespaceURI() {
+        if (state != TEXT_STATE) {
+            return name.getNamespaceURI();
+        } else {
+            return null;
+        }
+
+    }
+
+    public String getPrefix() {
+        if (state != TEXT_STATE) {
+            return name.getPrefix();
+        } else {
+            return null;
+        }
+    }
+
+    public String getVersion() {
+        return null;  //todo 1.0 ?
+    }
+
+    public boolean isStandalone() {
+        return false;
+    }
+
+    public boolean standaloneSet() {
+        return false;
+    }
+
+    public String getCharacterEncodingScheme() {
+        return null;
+    }
+
+    public String getPITarget() {
+        return null;
+    }
+
+    public String getPIData() {
+        return null;
+    }
+
+    public boolean hasNext() throws XMLStreamException {
+        return (state != FINAL_END_ELEMENT_STATE);
+    }
+
+    public void close() throws XMLStreamException {
+        //Do nothing - we've nothing to free here
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return namespaceContext.getNamespaceURI(prefix);
+    }
+
+    public boolean isStartElement() {
+        return (state == START_ELEMENT_STATE);
+    }
+
+    public boolean isEndElement() {
+        return (state == END_ELEMENT_STATE);
+    }
+
+    public boolean isCharacters() {
+        return (state == TEXT_STATE);
+    }
+
+    public boolean isWhiteSpace() {
+        return false;  //no whitespaces here
+    }
+
+    /**
+     * @param prefix
+     * @param uri
+     */
+    private void addToNsMap(String prefix, String uri) {
+        //todo - need to fix this up to cater for cases where
+        //namespaces are having  no prefixes
+        if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
+            //this namespace is not there. Need to declare it
+            namespaceContext.pushNamespace(prefix, uri);
+        }
+    }
+
+    /**
+     * Test whether the xsi namespace is present
+     *
+     * @return
+     */
+    private boolean isXsiNamespacePresent() {
+        return (namespaceContext.getNamespaceURI(NIL_QNAME.getPrefix()) != null);
+    }
+}

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,345 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.Location;
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class NameValuePairStreamReader implements ADBXMLStreamReader {
+
+    private static final int START_ELEMENT_STATE = 0;
+    private static final int TEXT_STATE = 1;
+    private static final int END_ELEMENT_STATE = 2;
+
+    private ADBNamespaceContext namespaceContext =
+            new ADBNamespaceContext();
+
+    private QName name;
+    private String value;
+
+    private int state = START_ELEMENT_STATE;
+    //initiate at the start element state
+
+    //keeps track whether the namespace is declared
+    //false by default
+    private boolean nsDeclared = false;
+
+    public NameValuePairStreamReader(QName name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public Object getProperty(String string) throws IllegalArgumentException {
+        //we've no properties here
+        return null;
+    }
+
+    public int next() throws XMLStreamException {
+        //no need to handle null here. it should have been handled
+        //already
+        switch (state){
+            case START_ELEMENT_STATE:
+                state=TEXT_STATE;
+                return CHARACTERS;
+             case END_ELEMENT_STATE:
+                 //oops, not supposed to happen!
+                throw new XMLStreamException("end already reached!");
+             case TEXT_STATE:
+                 state = END_ELEMENT_STATE;
+                 return END_ELEMENT;
+             default:
+                 throw new XMLStreamException("unknown event type!");
+        }
+    }
+
+    public void require(int i, String string, String string1) throws XMLStreamException {
+        //not implemented
+    }
+
+    public String getElementText() throws XMLStreamException {
+        if (state==START_ELEMENT){
+            //move to the end state and return the value
+            state = END_ELEMENT_STATE;
+            return value;
+        }else{
+            throw new XMLStreamException();
+        }
+
+    }
+
+    public int nextTag() throws XMLStreamException {
+        return 0;//todo
+    }
+
+    public boolean hasNext() throws XMLStreamException {
+        return (state!=END_ELEMENT_STATE);
+    }
+
+    public void close() throws XMLStreamException {
+        //Do nothing - we've nothing to free here
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return namespaceContext.getNamespaceURI(prefix);
+    }
+
+    public boolean isStartElement() {
+        return (state==START_ELEMENT_STATE);
+    }
+
+    public boolean isEndElement() {
+        return (state==END_ELEMENT_STATE);
+    }
+
+    public boolean isCharacters() {
+        return (state==TEXT_STATE);
+    }
+
+    public boolean isWhiteSpace() {
+        return false;  //no whitespaces here
+    }
+
+    public String getAttributeValue(String string, String string1) {
+        return null;
+    }
+
+    public int getAttributeCount() {
+        return 0;
+    }
+
+    public QName getAttributeName(int i) {
+        return null;
+    }
+
+    public String getAttributeNamespace(int i) {
+        return null;
+    }
+
+    public String getAttributeLocalName(int i) {
+        return null;
+    }
+
+    public String getAttributePrefix(int i) {
+        return null;
+    }
+
+    public String getAttributeType(int i) {
+        return null;
+    }
+
+    public String getAttributeValue(int i) {
+        return null;
+    }
+
+    public boolean isAttributeSpecified(int i) {
+        return false; //no attribs here
+    }
+
+    public int getNamespaceCount() {
+        return (nsDeclared)?1:0;
+    }
+
+    public String getNamespacePrefix(int i) {
+        return (nsDeclared && i==0)?name.getPrefix():null;
+    }
+
+    public String getNamespaceURI(int i) {
+        return (nsDeclared && i==0)?name.getNamespaceURI():null;
+    }
+
+    public NamespaceContext getNamespaceContext() {
+        return this.namespaceContext;
+    }
+
+    public int getEventType() {
+        switch (state){
+            case START_ELEMENT_STATE:
+                return START_ELEMENT;
+            case END_ELEMENT_STATE:
+                return END_ELEMENT;
+            case TEXT_STATE:
+                return CHARACTERS;
+            default:
+                throw new UnsupportedOperationException();
+                //we've no idea what this is!!!!!
+        }
+
+    }
+
+    public String getText() {
+        if (state==TEXT_STATE){
+            return value;
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public char[] getTextCharacters() {
+        if (state==TEXT_STATE){
+            return value.toCharArray();
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
+        //not implemented
+        throw new UnsupportedOperationException();
+    }
+
+    public int getTextStart() {
+        if (state==TEXT_STATE){
+            return 0;
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public int getTextLength() {
+        if (state==TEXT_STATE){
+            return value.length();
+        }else{
+            throw new  IllegalStateException();
+        }
+
+    }
+
+    public String getEncoding() {
+        return null;
+    }
+
+    public boolean hasText() {
+        return (state==TEXT_STATE);
+    }
+
+    public Location getLocation() {
+        return new Location(){
+            public int getLineNumber() {
+                return 0;
+            }
+
+            public int getColumnNumber() {
+                return 0;
+            }
+
+            public int getCharacterOffset() {
+                return 0;
+            }
+
+            public String getPublicId() {
+                return null;
+            }
+
+            public String getSystemId() {
+                return null;
+            }
+        };
+    }
+
+    public QName getName() {
+        if (state!=TEXT_STATE){
+            return name;
+        }else{
+            return null;
+        }
+    }
+
+    public String getLocalName() {
+        if (state!=TEXT_STATE){
+            return name.getLocalPart();
+        }else{
+            return null;
+        }
+    }
+
+    public boolean hasName() {
+        return (state != TEXT_STATE);
+
+    }
+
+    public String getNamespaceURI() {
+        if (state!=TEXT_STATE){
+           return name.getNamespaceURI();
+        }else{
+            return null;
+        }
+
+    }
+
+    public String getPrefix() {
+         if (state!=TEXT_STATE){
+           return name.getPrefix();
+        }else{
+            return null;
+        }
+    }
+
+    public String getVersion() {
+        return null;  //todo 1.0 ?
+    }
+
+    public boolean isStandalone() {
+        return false;
+    }
+
+    public boolean standaloneSet() {
+        return false;
+    }
+
+    public String getCharacterEncodingScheme() {
+        return null;
+    }
+
+    public String getPITarget() {
+        return null;
+    }
+
+    public String getPIData() {
+        return null;
+    }
+
+    public boolean isDone() {
+        return (state==END_ELEMENT_STATE);
+    }
+
+    public void addNamespaceContext(NamespaceContext nsContext) {
+        this.namespaceContext.setParentNsContext(nsContext);
+    }
+
+    public void init() {
+        //just add the current elements namespace and prefix to the this
+        //elements nscontext
+        addToNsMap(name.getPrefix(),name.getNamespaceURI());
+
+
+    }
+    /**
+     * @param prefix
+     * @param uri
+     */
+    private void addToNsMap(String prefix, String uri) {
+        //todo - need to fix this up to cater for cases where
+        //namespaces are having  no prefixes
+        if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
+            //this namespace is not there. Need to declare it
+            namespaceContext.pushNamespace(prefix, uri);
+            nsDeclared = true;
+        }
+    }
+
+}

Copied: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java (from r390389, webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/NullablePullParser.java)
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java?p2=webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java&p1=webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/NullablePullParser.java&r1=390389&r2=391258&rev=391258&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/NullablePullParser.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java Tue Apr  4 02:19:13 2006
@@ -1,4 +1,4 @@
-package org.apache.axis2.databinding.utils;
+package org.apache.axis2.databinding.utils.reader;
 
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
@@ -21,21 +21,21 @@
  * limitations under the License.
  */
 
-public class NullablePullParser implements XMLStreamReader {
+public class NullXMLStreamReader implements ADBXMLStreamReader {
 
     private QName outerQName = null;
 
-    private static final int INIT_STATE = 0;
+
     private static final int START_ELEMENT_STATE = 1;
     private static final int END_ELEMENT_STATE = 2;
-    private static final int FINISHED_STATE = 3;
+
 
     private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance","nil","xsi");
     private static final String NIL_VALUE_TRUE ="true";
 
-    private int currentState = INIT_STATE;
+    private int currentState = START_ELEMENT;
 
-    public NullablePullParser(QName outerQName) {
+    public NullXMLStreamReader(QName outerQName) {
         this.outerQName = outerQName;
     }
 
@@ -46,20 +46,13 @@
     public int next() throws XMLStreamException {
         int returnEvent = START_DOCUMENT;
         switch(currentState){
-            case INIT_STATE:
-                currentState = START_ELEMENT_STATE;
-                returnEvent =  START_ELEMENT;
-                break;
             case START_ELEMENT_STATE:
                 currentState = END_ELEMENT_STATE;
                 returnEvent =  END_ELEMENT;
                 break;
             case END_ELEMENT_STATE:
-                currentState = FINISHED_STATE;
-                returnEvent =  END_DOCUMENT;
-                break;
-            case FINISHED_STATE:
-                throw new XMLStreamException("parser completed!");
+               throw new XMLStreamException("parser completed!");
+
         }
 
         return returnEvent;
@@ -125,19 +118,19 @@
     }
 
     public QName getAttributeName(int i) {
-        return (i==1)? NIL_QNAME:null;
+        return (i==0)? NIL_QNAME:null;
     }
 
     public String getAttributeNamespace(int i) {
-        return (i==1)? NIL_QNAME.getNamespaceURI():null;
+        return (i==0)? NIL_QNAME.getNamespaceURI():null;
     }
 
     public String getAttributeLocalName(int i) {
-        return (i==1)? NIL_QNAME.getLocalPart():null;
+        return (i==0)? NIL_QNAME.getLocalPart():null;
     }
 
     public String getAttributePrefix(int i) {
-        return (i==1)? NIL_QNAME.getPrefix():null;
+        return (i==0)? NIL_QNAME.getPrefix():null;
     }
 
     public String getAttributeType(int i) {
@@ -145,11 +138,11 @@
     }
 
     public String getAttributeValue(int i) {
-        return (i==1)? NIL_VALUE_TRUE:null;
+        return (i==0)? NIL_VALUE_TRUE:null;
     }
 
     public boolean isAttributeSpecified(int i) {
-        return (i == 1);
+        return (i == 0);
     }
 
     public int getNamespaceCount() {
@@ -171,17 +164,13 @@
     public int getEventType() {
         int returnEvent = START_DOCUMENT;
         switch(currentState){
-            case INIT_STATE:
-                returnEvent =  START_DOCUMENT;
-                break;
             case START_ELEMENT_STATE:
                 returnEvent =  START_ELEMENT;
                 break;
             case END_ELEMENT_STATE:
                 returnEvent =  END_ELEMENT;
                 break;
-            case FINISHED_STATE:
-               returnEvent = END_DOCUMENT;
+
         }
        return returnEvent;
     }
@@ -215,7 +204,27 @@
     }
 
     public Location getLocation() {
-        throw new UnsupportedOperationException();
+        return new Location(){
+            public int getLineNumber() {
+                return 0;
+            }
+
+            public int getColumnNumber() {
+                return 0;
+            }
+
+            public int getCharacterOffset() {
+                return 0;
+            }
+
+            public String getPublicId() {
+                return null;
+            }
+
+            public String getSystemId() {
+                return null;
+            }
+        };
     }
 
     public QName getName() {
@@ -260,5 +269,17 @@
 
     public String getPIData() {
         throw new UnsupportedOperationException();
+    }
+
+    public boolean isDone() {
+        return (currentState==END_ELEMENT_STATE);
+    }
+
+    public void addNamespaceContext(NamespaceContext nsContext) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void init() {
+        //To change body of implemented methods use File | Settings | File Templates.
     }
 }

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java?rev=391258&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java Tue Apr  4 02:19:13 2006
@@ -0,0 +1,25 @@
+package org.apache.axis2.databinding.utils.reader;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A dummy object that acts as the key for the OMAttribute in the
+ * attribute array - this will be provided as part of the constants
+ * 
+ */
+public class OMAttribKey {
+
+}