ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r391929 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/databinding/utils/reader/ codegen/src/org/apache/axis2/schema/ codegen/src/org/apache/axis2/schema/template/ codegen/sr...
Date Thu, 06 Apr 2006 08:13:40 GMT
Author: ajith
Date: Thu Apr  6 01:13:37 2006
New Revision: 391929

URL: http://svn.apache.org/viewcvs?rev=391929&view=rev
Log:
Did the modifications to incorporate the Datahandler for the base64Binary content
1. Changed the converters
2. Added a new ADBDataHandlerStreamReader.java to cater for handling DataHandler.
3. Modified the other implementations of XMLStreamReader to provide proper properties as per the discussion about supporting MTOM
4. Modified  the ScheamCompiler and related classes to handle the Base64Content differently
5. Made the status maintenance inside BeanWriterMetaInfoHolder.java a bit more efficient.

some decent testcases are still pending

Added:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.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/NameValuePairStreamReader.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.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/schema/typemap/JavaTypeMap.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java

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=391929&r1=391928&r2=391929&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 Thu Apr  6 01:13:37 2006
@@ -18,7 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-                                              
+
 public interface Constants {
 
     static  String NIL="nil";
@@ -27,4 +27,8 @@
 
     static Object OM_ATTRIBUTE_KEY = new OMAttribKey();
     static Object OM_ELEMENT_KEY = new OMElementKey();
+
+    static final String IS_BINARY = "Axiom.IsBinary";
+    static final String DATA_HANDLER = "Axiom.DataHandler";
+    static final String OPTIMIZATION_ENABLED = "Axiom.opt.enabled";
 }

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Thu Apr  6 01:13:37 2006
@@ -3,6 +3,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.apache.axis2.databinding.types.Day;
 import org.apache.axis2.databinding.types.Duration;
 import org.apache.axis2.databinding.types.Entities;
@@ -39,7 +40,9 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.activation.DataHandler;
 import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.lang.reflect.Array;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -216,6 +219,10 @@
         return Base64.encode(bytes);
     }
 
+     public static String convertToString(javax.activation.DataHandler handler) {
+        return getStringFromDatahandler(handler);
+     }
+
     /* ################################################################################ */
     /* String to java type conversions
        These methods have a special signature structure
@@ -315,8 +322,13 @@
         return new HexBinary(s);
     }
 
-    public static byte[] convertTobase64Binary(String s) throws Exception{
-        return Base64.decode(s);
+    public static javax.activation.DataHandler convertTobase64Binary(String s)
+            throws Exception{
+        // reusing the byteArrayDataSource from the Axiom classes
+        ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(
+                s.getBytes()
+        );
+        return new DataHandler(byteArrayDataSource);
     }
 
     /**
@@ -702,4 +714,31 @@
         }
     }
 
+    /**
+     * Converts the given datahandler to a string
+     * @return
+     * @throws XMLStreamException
+     */
+    public static String getStringFromDatahandler(DataHandler dataHandler){
+        try {
+            InputStream inStream;
+            inStream = dataHandler.getDataSource().getInputStream();
+            byte[] data;
+            StringBuffer text = new StringBuffer();
+            do {
+                data = new byte[1024];
+                int len;
+                while ((len = inStream.read(data)) > 0) {
+                    byte[] temp = new byte[len];
+                    System.arraycopy(data, 0, temp, 0, len);
+                    text.append(Base64.encode(temp));
+                }
+
+            } while (inStream.available() > 0);
+
+            return text.toString();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 }

Added: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java?rev=391929&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java (added)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java Thu Apr  6 01:13:37 2006
@@ -0,0 +1,384 @@
+package org.apache.axis2.databinding.utils.reader;
+
+import org.apache.axis2.databinding.utils.Constants;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+import org.apache.axis2.util.Base64;
+
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.Location;
+import javax.activation.DataHandler;
+import java.io.InputStream;
+/*
+ * 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 ADBDataHandlerStreamReader 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 DataHandler 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 ADBDataHandlerStreamReader(QName name, DataHandler value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    private String convertedText = null;
+
+    /**
+     * Return the right properties for the optimization
+     * @param propKey
+     * @return
+     * @throws IllegalArgumentException
+     */
+    public Object getProperty(String propKey) throws IllegalArgumentException {
+        if (OPTIMIZATION_ENABLED.equals(propKey)){
+            return Boolean.TRUE;
+        }
+        if (state==TEXT_STATE){
+            if (IS_BINARY.equals(propKey)){
+                return Boolean.TRUE;
+            }else if (DATA_HANDLER.equals(propKey)){
+                return value;
+            }
+        }
+        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;
+            if (convertedText==null){
+                convertedText = ConverterUtil.getStringFromDatahandler(value);
+            }
+            return convertedText;
+        }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){
+            if (convertedText==null){
+                convertedText =
+                        ConverterUtil.getStringFromDatahandler(value);
+            }
+            return convertedText;
+        }else{
+            throw new IllegalStateException();
+        }
+    }
+
+    public char[] getTextCharacters() {
+        if (state==TEXT_STATE){
+            if (convertedText==null){
+                convertedText =
+                        ConverterUtil.getStringFromDatahandler(value);
+            }
+            return convertedText.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){
+            if (convertedText==null){
+                convertedText =
+                        ConverterUtil.getStringFromDatahandler(value);
+            }
+            return convertedText.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;
+        }
+    }
+
+
+}

Modified: 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=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java Thu Apr  6 01:13:37 2006
@@ -1,5 +1,7 @@
 package org.apache.axis2.databinding.utils.reader;
 
+import org.apache.axis2.databinding.utils.Constants;
+
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.namespace.NamespaceContext;
 /*
@@ -18,7 +20,7 @@
  * limitations under the License.
  */
 
-public interface ADBXMLStreamReader extends XMLStreamReader {
+public interface ADBXMLStreamReader extends XMLStreamReader,Constants {
 
     // this will help to handle Text within the current element.
     // user should pass the element text to the property list as this

Modified: 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=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java Thu Apr  6 01:13:37 2006
@@ -11,6 +11,7 @@
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.activation.DataHandler;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
@@ -130,11 +131,31 @@
         populateNamespaceContext();
     }
 
-    public Object getProperty(String string) throws IllegalArgumentException {
+    /**
+     *
+     * @param key
+     * @return
+     * @throws IllegalArgumentException
+     */
+    public Object getProperty(String key) throws IllegalArgumentException {
         if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+            if (OPTIMIZATION_ENABLED.equals(key)){
+                return Boolean.TRUE;
+            }else{
+                return null;
+            }
+        }else if (state==TEXT_STATE){
+            if (IS_BINARY.equals(key)){
+                return Boolean.FALSE;
+            }else{
+                return null;
+            }
+        }else if (state==DELEGATED_STATE){
+            return childReader.getProperty(key);
+        }else{
             return null;
         }
-        return childReader.getProperty(string);
+
     }
 
     public int next() throws XMLStreamException {
@@ -584,7 +605,6 @@
 
     /**
      * check the validity of this implementation
-     *
      * @return
      */
     public boolean hasText() {
@@ -876,6 +896,16 @@
             //if the value is null we delegate the work to a nullable
             // parser
             childReader = new NullXMLStreamReader(propertyQName);
+            childReader.addNamespaceContext(this.namespaceContext);
+            childReader.init();
+
+            //we've a special pullparser for a datahandler!
+        } else if (propertyValue instanceof DataHandler) {
+            childReader = new ADBDataHandlerStreamReader(propertyQName,
+                    (DataHandler)propertyValue);
+            childReader.addNamespaceContext(this.namespaceContext);
+            childReader.init();
+
         } else if (propertyValue instanceof String) {
             //strings are handled by the NameValuePairStreamReader
             childReader =
@@ -887,7 +917,7 @@
             //string[] are handled by the  NameValueArrayStreamReader
             //if the array is empty - skip it
             if (((String[])propertyValue).length==0){
-                 //advance the index
+                //advance the index
                 currentPropertyIndex = currentPropertyIndex + 2;
                 return processProperties();
             }else{

Modified: 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=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java Thu Apr  6 01:13:37 2006
@@ -44,9 +44,20 @@
         this.value = value;
     }
 
-    public Object getProperty(String string) throws IllegalArgumentException {
-        //we've no properties here
-        return null;
+    public Object getProperty(String key) throws IllegalArgumentException {
+        //since optimization is a global property
+        //we've to implement it everywhere
+        if (OPTIMIZATION_ENABLED.equals(key)){
+            return Boolean.TRUE;
+        }else if (state==TEXT_STATE){
+            if (IS_BINARY.equals(key)){
+                return Boolean.FALSE;
+            }else{
+                return null;
+            }
+        }else{
+            return null;
+        }
     }
 
     public int next() throws XMLStreamException {
@@ -56,14 +67,14 @@
             case START_ELEMENT_STATE:
                 state=TEXT_STATE;
                 return CHARACTERS;
-             case END_ELEMENT_STATE:
-                 //oops, not supposed to happen!
+            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!");
+            case TEXT_STATE:
+                state = END_ELEMENT_STATE;
+                return END_ELEMENT;
+            default:
+                throw new XMLStreamException("unknown event type!");
         }
     }
 
@@ -274,7 +285,7 @@
 
     public String getNamespaceURI() {
         if (state!=TEXT_STATE){
-           return name.getNamespaceURI();
+            return name.getNamespaceURI();
         }else{
             return null;
         }
@@ -282,8 +293,8 @@
     }
 
     public String getPrefix() {
-         if (state!=TEXT_STATE){
-           return name.getPrefix();
+        if (state!=TEXT_STATE){
+            return name.getPrefix();
         }else{
             return null;
         }

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java Thu Apr  6 01:13:37 2006
@@ -39,8 +39,14 @@
         this.outerQName = outerQName;
     }
 
-    public Object getProperty(String string) throws IllegalArgumentException {
-        throw new UnsupportedOperationException();
+    public Object getProperty(String key) throws IllegalArgumentException {
+         //since optimization is a global property
+        //we've to implement it everywhere
+        if (OPTIMIZATION_ENABLED.equals(key)){
+               return Boolean.TRUE;
+           }else{
+               return null;
+           }
     }
 
     public int next() throws XMLStreamException {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java Thu Apr  6 01:13:37 2006
@@ -50,6 +50,7 @@
 
 
 
+
     //the parent metainfo holder, useful in handling extensions and
     //restrictions
     protected BeanWriterMetaInfoHolder parent = null;
@@ -186,10 +187,10 @@
      * @param javaClassName
      * @param type
      */
-    public void registerMapping(QName qName, QName schemaName, String javaClassName, Integer type) {
+    public void registerMapping(QName qName, QName schemaName, String javaClassName, int type) {
         this.elementToJavaClassMap.put(qName, javaClassName);
         this.elementToSchemaQNameMap.put(qName, schemaName);
-        this.specialTypeFlagMap.put(qName, type);
+        addtStatus(qName, type);
 
     }
 
@@ -220,9 +221,9 @@
      * @return Returns boolean.
      */
     public boolean getAttributeStatusForQName(QName qName) {
-        Integer attribState = (Integer) specialTypeFlagMap.get(qName);
-        return attribState != null && (attribState.equals(SchemaConstants.ATTRIBUTE_TYPE)
-                || attribState.equals(SchemaConstants.ANY_ATTRIBUTE_TYPE));
+
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),SchemaConstants.ATTRIBUTE_TYPE);
     }
 
     /**
@@ -232,8 +233,8 @@
      * @return Returns boolean.
      */
     public boolean getAnyStatusForQName(QName qName) {
-        Integer anyState = (Integer) specialTypeFlagMap.get(qName);
-        return anyState != null && anyState.equals(SchemaConstants.ANY);
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),SchemaConstants.ANY_TYPE);
     }
 
     /**
@@ -244,21 +245,30 @@
      */
     public boolean getArrayStatusForQName(QName qName) {
         Integer state = (Integer) specialTypeFlagMap.get(qName);
-        return state != null && (
-                state.equals(SchemaConstants.ARRAY_TYPE) ||
-                state.equals(SchemaConstants.ANY_ARRAY_TYPE));
+        return state != null && getStatus(state.intValue(),
+                SchemaConstants.ARRAY_TYPE);
     }
 
     /**
+     * Gets whether a given QName refers to an array.
+     *
+     * @param qName
+     * @return Returns boolean.
+     */
+    public boolean getBinaryStatusForQName(QName qName) {
+        Integer state = (Integer) specialTypeFlagMap.get(qName);
+        return state != null && getStatus(state.intValue(),
+                SchemaConstants.BINARY_TYPE);
+    }
+    /**
      * Gets whether a given QName has the any attribute status.
      *
      * @param qName
      * @return Returns boolean.
      */
     public boolean getAnyAttributeStatusForQName(QName qName) {
-        Integer anyState = (Integer) specialTypeFlagMap.get(qName);
-        return anyState != null &&
-                anyState.equals(SchemaConstants.ANY_ATTRIBUTE_TYPE);
+       return getArrayStatusForQName(qName) &&
+               getAnyStatusForQName(qName);
     }
 
     /**
@@ -391,7 +401,31 @@
      */
     public void setAsParent(BeanWriterMetaInfoHolder metaInfo){
         parent = metaInfo;
+    }
+
+    /**
+     * Adds a another status to a particular Qname.
+     * A Qname can be associated with multiple status flags
+     * and they all will be preserved
+     * @param type
+     * @param mask
+     */
+
+    public void addtStatus(QName type,int mask){
+        Object obj = this.specialTypeFlagMap.get(type);
+        if (obj!=null){
+            int preValue = ((Integer)obj).intValue();
+            this.specialTypeFlagMap.put(type, new Integer((preValue | mask)));
+        }else{
+            this.specialTypeFlagMap.put(type, new Integer(mask));
+        }
+
+    }
 
 
+    private boolean getStatus(int storedStatus,int mask){
+        //when the mask is anded with the status then we should get
+        //the mask it self!
+        return (mask==(mask & storedStatus));
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java Thu Apr  6 01:13:37 2006
@@ -625,7 +625,7 @@
      * @throws SchemaCompilationException
      */
     private void writeComplexType(XmlSchemaComplexType complexType, BeanWriterMetaInfoHolder metaInfHolder, String fullyQualifiedClassName)
-    throws SchemaCompilationException {
+            throws SchemaCompilationException {
         writer.write(complexType, processedTypemap, metaInfHolder, fullyQualifiedClassName);
         processedTypeMetaInfoMap.put(complexType.getQName(),metaInfHolder);
     }
@@ -734,8 +734,8 @@
 
         }else if (content instanceof XmlSchemaComplexContentRestriction){
             //todo handle complex restriction here
-             throw new SchemaCompilationException(
-                                SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Complex Content"));
+            throw new SchemaCompilationException(
+                    SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Complex Content"));
         }
     }
 
@@ -807,12 +807,12 @@
         content = simpleContent.getContent();
         if (content instanceof XmlSchemaSimpleContentExtension){
             //todo - handle simple type extension here
-             throw new SchemaCompilationException(
-                                SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Extension"));
+            throw new SchemaCompilationException(
+                    SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Extension"));
         }else if (content instanceof XmlSchemaSimpleContentRestriction){
             //todo - Handle simple type restriction here
             throw new SchemaCompilationException(
-                                SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Restriction"));
+                    SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Content Restriction"));
 
         }
     }
@@ -826,10 +826,14 @@
         //The best thing we can do here is to add a set of OMAttributes
         //since attributes do not have the notion of minoccurs/maxoccurs the
         //safest option here is to have an OMAttribute array
-        metainf.registerMapping(new QName(EXTRA_ATTRIBUTE_FIELD_NAME),
+        QName qName = new QName(EXTRA_ATTRIBUTE_FIELD_NAME);
+        metainf.registerMapping(qName,
                 null,
-                DEFAULT_ATTRIB_ARRAY_CLASS_NAME,
-                SchemaConstants.ANY_ATTRIBUTE_TYPE);
+                DEFAULT_ATTRIB_ARRAY_CLASS_NAME,//always generate an array of
+                                                //OMAttributes
+                SchemaConstants.ANY_TYPE);
+        metainf.addtStatus(qName, SchemaConstants.ATTRIBUTE_TYPE);
+        metainf.addtStatus(qName, SchemaConstants.ARRAY_TYPE);
 
     }
 
@@ -950,6 +954,7 @@
                             ((Boolean) processedElementArrayStatusMap.get(elt)).booleanValue() ?
                                     SchemaConstants.ARRAY_TYPE :
                                     SchemaConstants.ELEMENT_TYPE);
+
                 }else{ //probably this is referenced
                     referencedQName = elt.getRefName();
                     boolean arrayStatus = ((Boolean) processedElementArrayStatusMap.get(elt)).booleanValue();
@@ -980,6 +985,11 @@
                     metainfHolder.registerNillableQName(elt.getQName());
                 }
 
+                //get the binary state and add that to the status map
+                if (isBinary(elt)){
+                    metainfHolder.addtStatus(elt.getQName(),
+                           SchemaConstants.BINARY_TYPE);
+                }
                 // process the XMLSchemaAny
             }else if (child instanceof XmlSchemaAny){
                 XmlSchemaAny any = (XmlSchemaAny)child;
@@ -994,8 +1004,12 @@
                 metainfHolder.registerMapping(anyElementFieldName,
                         null,
                         isArray?DEFAULT_CLASS_ARRAY_NAME:DEFAULT_CLASS_NAME,
-                        isArray?SchemaConstants.ANY_ARRAY_TYPE:SchemaConstants.ANY);
-
+                        SchemaConstants.ANY_TYPE);
+                //if it's an array register an extra status flag with the system
+                if (isArray){
+                    metainfHolder.addtStatus(anyElementFieldName,
+                            SchemaConstants.ARRAY_TYPE);
+                }
                 metainfHolder.addMaxOccurs(anyElementFieldName,any.getMaxOccurs());
                 metainfHolder.addMinOccurs(anyElementFieldName,any.getMinOccurs());
 
@@ -1005,11 +1019,7 @@
                     metainfHolder.registerQNameIndex(anyElementFieldName,
                             startingItemNumberOrder + integer.intValue());
                 }
-
-
             }
-
-
         }
 
         //set the ordered flag in the metainf holder
@@ -1017,6 +1027,16 @@
     }
 
     /**
+     * Checks whether a given element is a binary element
+     * @param elt
+     * @return
+     */
+    private boolean isBinary(XmlSchemaElement elt) {
+        return elt.getSchemaType()!=null &&
+                SchemaConstants.XSD_BASE64.equals(elt.getSchemaType().getQName());
+    }
+
+    /**
      * Handle the simple content
      *
      * @param simpleType
@@ -1045,12 +1065,12 @@
             }else if (content instanceof XmlSchemaSimpleTypeUnion) {
                 //Todo - Handle unions here
                 throw new SchemaCompilationException(
-                                SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type Uniont"));
+                        SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type Uniont"));
 
             }else if (content instanceof XmlSchemaSimpleTypeList){
                 //todo - Handle lists here
-                 throw new SchemaCompilationException(
-                                SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type List"));
+                throw new SchemaCompilationException(
+                        SchemaCompilerMessages.getMessage("schema.unsupportedcontenterror","Simple Type List"));
             }
 
         }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java Thu Apr  6 01:13:37 2006
@@ -80,13 +80,14 @@
     public static final QName XSD_NORMALIZEDSTRING = new QName(URI_DEFAULT_SCHEMA_XSD, "normalizedString");
     public static final QName XSD_TOKEN = new QName(URI_DEFAULT_SCHEMA_XSD, "token");
 
-    public static final Integer ATTRIBUTE_TYPE = new Integer(0);
-    public static final Integer ANY = new Integer(1);
-    public static final Integer ELEMENT_TYPE = new Integer(2);
-    public static final Integer ANY_ATTRIBUTE_TYPE = new Integer(3);
-    public static final Integer ARRAY_TYPE = new Integer(4);
-    public static final Integer ANY_TYPE = new Integer(5);
-    public static final Integer ANY_ARRAY_TYPE = new Integer(6);
+    //bit patterns for the types
+    public static final int ATTRIBUTE_TYPE = 0x01;
+    //public static final int ANY = 0x02;
+    public static final int ELEMENT_TYPE = 0x02;
+    //public static final int ANY_ATTRIBUTE_TYPE = 0x08;
+    public static final int ARRAY_TYPE = 0x04;
+    public static final int ANY_TYPE = 0x08;
+    public static final int BINARY_TYPE = 0x10;
 
 
     public static class SchemaPropertyNames{

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl Thu Apr  6 01:13:37 2006
@@ -275,13 +275,13 @@
                             <!--we've opened a bracket for the nulls - fix it here-->
                             <xsl:if test="@nillable">}</xsl:if>
                         </xsl:when>
-                        <!-- handle non ADB arrays -->
-                        <xsl:when test="@array">
+                        <!-- handle non ADB arrays - Not any however -->
+                        <xsl:when test="@array and not(@any)">
                              <xsl:choose>
                                 <xsl:when test="@nillable">
                                     // this property is nillable
                                     if (<xsl:value-of select="$varName"/>!=null){
-                                    <!--this barcket needs to be closed!-->
+                                    <!--this bracket needs to be closed!-->
                                 </xsl:when>
                                 <xsl:otherwise>
                                     if (<xsl:value-of select="$varName"/>==null){
@@ -298,11 +298,30 @@
                             <!--we've opened a bracket for the nulls - fix it here-->
                             <xsl:if test="@nillable">}</xsl:if>
                         </xsl:when>
-                        <!-- handle any-->
+
+                         <!-- handle non ADB arrays  - Any case  - any may not be
+                         nillable -->
+                        <xsl:when test="@array and @any">
+                            for (int i = 0;i &lt; <xsl:value-of select="$varName"/>.length;i++){
+                              elementList.add(new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>",
+                                                                      "<xsl:value-of select="$propertyName"/>"));
+                              elementList.add(
+                              org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>[i]));
+                            }
+                            <!--we've opened a bracket for the nulls - fix it here-->
+                        </xsl:when>
+                        <!-- handle any - non array case-->
                          <xsl:when test="@any">
                             elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY);
                             elementList.add(<xsl:value-of select="$varName"/>);
                         </xsl:when>
+                        <!-- handle binary - Since it is a Datahandler, we can just add it to the list
+                          and the ADB pullparser would handle it right-->
+                         <xsl:when test="@binary">
+                            elementList.add(new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>",
+                                                                      "<xsl:value-of select="$propertyName"/>"));
+                            elementList.add(<xsl:value-of select="$varName"/>);
+                        </xsl:when>
                         <!-- the usual case!!!!-->
                         <xsl:otherwise>
                              elementList.add(new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>",
@@ -327,10 +346,16 @@
                     <xsl:variable name="varName">local<xsl:value-of select="@javaname"/></xsl:variable>
                      <xsl:variable name="namespace"><xsl:value-of select="@nsuri"/></xsl:variable>
                     <xsl:choose>
-                        <xsl:when test="@anyAtt">
+                        <xsl:when test="@any and not(@array)">
                             attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY);
                             attribList.add(<xsl:value-of select="$varName"/>);
                         </xsl:when>
+                         <xsl:when test="@any and @array">
+                             for (int i=0;i &lt;<xsl:value-of select="$varName"/>.length;i++){
+                               attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY);
+                               attribList.add(<xsl:value-of select="$varName"/>[i]);
+                             }
+                         </xsl:when>
                         <xsl:otherwise>
                             attribList.add(
                             new javax.xml.namespace.QName("<xsl:value-of select="$namespace"/>","<xsl:value-of select="$propertyName"/>"));
@@ -377,7 +402,7 @@
                                       org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT,
                                        org.apache.axis2.databinding.utils.ConverterUtil.convertToString(<xsl:value-of select="$varName"/>)
                                        },
-                                       new Object[]{});
+                                       null);
                                 }
                             </xsl:when>
                             <xsl:otherwise> return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(MY_QNAME,
@@ -1027,7 +1052,7 @@
 
 
      <!-- end of the template -->
-   
+
         </xsl:otherwise>
     </xsl:choose>
         }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java Thu Apr  6 01:13:37 2006
@@ -67,14 +67,16 @@
 
     static {
         // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
-        addTypemapping(SchemaConstants.XSD_STRING, java.lang.String.class.getName());
+        addTypemapping(SchemaConstants.XSD_STRING,
+                java.lang.String.class.getName());
 
         // The XSD Primitives are mapped to java primitives.
         addTypemapping(SchemaConstants.XSD_BOOLEAN, boolean.class.getName());
         addTypemapping(SchemaConstants.XSD_DOUBLE, double.class.getName());
         addTypemapping(SchemaConstants.XSD_FLOAT, float.class.getName());
         addTypemapping(SchemaConstants.XSD_INT, int.class.getName());
-        addTypemapping(SchemaConstants.XSD_INTEGER, java.math.BigInteger.class.getName());
+        addTypemapping(SchemaConstants.XSD_INTEGER,
+                java.math.BigInteger.class.getName());
         addTypemapping(SchemaConstants.XSD_LONG, long.class.getName());
         addTypemapping(SchemaConstants.XSD_SHORT, short.class.getName());
         addTypemapping(SchemaConstants.XSD_BYTE, byte.class.getName());
@@ -82,56 +84,81 @@
         addTypemapping(SchemaConstants.XSD_DECIMAL, BigDecimal.class.getName());
 
         //anytype is mapped to the OMElement instead of the java.lang.Object
-        addTypemapping(SchemaConstants.XSD_ANYTYPE, OMElement.class.getName());
+        addTypemapping(SchemaConstants.XSD_ANYTYPE,
+                OMElement.class.getName());
 
         //Qname maps to  jax rpc QName class
-        addTypemapping(SchemaConstants.XSD_QNAME, javax.xml.namespace.QName.class.getName());
+        addTypemapping(SchemaConstants.XSD_QNAME,
+                javax.xml.namespace.QName.class.getName());
 
         //xsd Date is mapped to the java.util.date!
-        addTypemapping(SchemaConstants.XSD_DATE, java.util.Date.class.getName());
+        addTypemapping(SchemaConstants.XSD_DATE,
+                java.util.Date.class.getName());
 
         // Mapping for xsd:time.  Map to Axis type Time
-        addTypemapping(SchemaConstants.XSD_TIME, Time.class.getName());
-        addTypemapping(SchemaConstants.XSD_DATETIME, java.util.Calendar.class.getName());
-        addTypemapping(SchemaConstants.XSD_BASE64, "byte[]");    //todo need to be fixed!
-        addTypemapping(SchemaConstants.XSD_HEXBIN, HexBinary.class.getName());
+        addTypemapping(SchemaConstants.XSD_TIME,
+                Time.class.getName());
+        addTypemapping(SchemaConstants.XSD_DATETIME,
+                java.util.Calendar.class.getName());
+
+        //as for the base 64 encoded binary stuff we map it to a javax.
+        // activation.Datahandler object
+        addTypemapping(SchemaConstants.XSD_BASE64,
+                javax.activation.DataHandler.class.getName());
+        
+        addTypemapping(SchemaConstants.XSD_HEXBIN,
+                HexBinary.class.getName());
 
         // These are the g* types (gYearMonth, etc) which map to Axis types
-        addTypemapping(SchemaConstants.XSD_YEARMONTH, YearMonth.class.getName());
-        addTypemapping(SchemaConstants.XSD_YEAR, Year.class.getName());
-        addTypemapping(SchemaConstants.XSD_MONTH, Month.class.getName());
-        addTypemapping(SchemaConstants.XSD_DAY, Day.class.getName());
-        addTypemapping(SchemaConstants.XSD_MONTHDAY, MonthDay.class.getName());
+        addTypemapping(SchemaConstants.XSD_YEARMONTH,
+                YearMonth.class.getName());
+        addTypemapping(SchemaConstants.XSD_YEAR,
+                Year.class.getName());
+        addTypemapping(SchemaConstants.XSD_MONTH,
+                Month.class.getName());
+        addTypemapping(SchemaConstants.XSD_DAY,
+                Day.class.getName());
+        addTypemapping(SchemaConstants.XSD_MONTHDAY,
+                MonthDay.class.getName());
 
         // xsd:token
         addTypemapping(SchemaConstants.XSD_TOKEN, Token.class.getName());
 
         // a xsd:normalizedString
-        addTypemapping(SchemaConstants.XSD_NORMALIZEDSTRING, NormalizedString.class.getName());
+        addTypemapping(SchemaConstants.XSD_NORMALIZEDSTRING,
+                NormalizedString.class.getName());
 
         // a xsd:unsignedLong
-        addTypemapping(SchemaConstants.XSD_UNSIGNEDLONG, UnsignedLong.class.getName());
+        addTypemapping(SchemaConstants.XSD_UNSIGNEDLONG,
+                UnsignedLong.class.getName());
 
         // a xsd:unsignedInt
-        addTypemapping(SchemaConstants.XSD_UNSIGNEDINT, UnsignedInt.class.getName());
+        addTypemapping(SchemaConstants.XSD_UNSIGNEDINT,
+                UnsignedInt.class.getName());
 
         // a xsd:unsignedShort
-        addTypemapping(SchemaConstants.XSD_UNSIGNEDSHORT, UnsignedShort.class.getName());
+        addTypemapping(SchemaConstants.XSD_UNSIGNEDSHORT,
+                UnsignedShort.class.getName());
 
         // a xsd:unsignedByte
-        addTypemapping(SchemaConstants.XSD_UNSIGNEDBYTE, UnsignedByte.class.getName());
+        addTypemapping(SchemaConstants.XSD_UNSIGNEDBYTE,
+                UnsignedByte.class.getName());
 
         // a xsd:nonNegativeInteger
-        addTypemapping(SchemaConstants.XSD_NONNEGATIVEINTEGER, NonNegativeInteger.class.getName());
+        addTypemapping(SchemaConstants.XSD_NONNEGATIVEINTEGER,
+                NonNegativeInteger.class.getName());
 
         // a xsd:negativeInteger
-        addTypemapping(SchemaConstants.XSD_NEGATIVEINTEGER, NegativeInteger.class.getName());
+        addTypemapping(SchemaConstants.XSD_NEGATIVEINTEGER,
+                NegativeInteger.class.getName());
 
         // a xsd:positiveInteger
-        addTypemapping(SchemaConstants.XSD_POSITIVEINTEGER, PositiveInteger.class.getName());
+        addTypemapping(SchemaConstants.XSD_POSITIVEINTEGER,
+                PositiveInteger.class.getName());
 
         // a xsd:nonPositiveInteger
-        addTypemapping(SchemaConstants.XSD_NONPOSITIVEINTEGER, NonPositiveInteger.class.getName());
+        addTypemapping(SchemaConstants.XSD_NONPOSITIVEINTEGER,
+                NonPositiveInteger.class.getName());
 
         // a xsd:Name
         addTypemapping(SchemaConstants.XSD_NAME, Name.class.getName());

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=391929&r1=391928&r2=391929&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Thu Apr  6 01:13:37 2006
@@ -494,10 +494,9 @@
                 XSLTUtils.addAttribute(model, "any", "yes", property);
             }
 
-            if (metainf.getAnyAttributeStatusForQName(name)) {
-                XSLTUtils.addAttribute(model, "anyAtt", "yes", property);
+             if (metainf.getBinaryStatusForQName(name)) {
+                XSLTUtils.addAttribute(model, "binary", "yes", property);
             }
-
             //put the min occurs count irrespective of whether it's an array or not
             long minOccurs = metainf.getMinOccurs(name);
             XSLTUtils.addAttribute(model, "minOccurs", minOccurs + "", property);



Mime
View raw message