axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/encoding MixedContentType.java
Date Thu, 25 Mar 2004 10:36:38 GMT
dims        2004/03/25 02:36:38

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
  Added:       java/src/org/apache/axis/encoding MixedContentType.java
  Log:
  Fix for AXIS-1170 - mixed=true on complex types not supported
  from  Jarek Gawor
  
  Revision  Changes    Path
  1.59      +22 -0     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java
  
  Index: JavaBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- JavaBeanWriter.java	24 Mar 2004 17:36:37 -0000	1.58
  +++ JavaBeanWriter.java	25 Mar 2004 10:36:38 -0000	1.59
  @@ -23,6 +23,7 @@
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
   import org.w3c.dom.DOMException;
   import org.w3c.dom.Node;
  +import org.w3c.dom.Element;
   
   import javax.xml.namespace.QName;
   import java.io.IOException;
  @@ -99,6 +100,10 @@
       /** Field isAny */
       protected boolean isAny = false;
   
  +    /** Field isMixed */
  +    protected boolean isMixed = false;
  +    
  +
       /**
        * Constructor.
        * 
  @@ -285,6 +290,19 @@
               }
           }
   
  +	if (!type.isSimpleType()) {
  +	    Node node = type.getNode();
  +	    String mixed = ((Element)node).getAttribute("mixed");
  +	    if ("true".equalsIgnoreCase(mixed) ||
  +		"1".equals(mixed)) {
  +		isMixed = true;
  +		if (!isAny) {
  +		    names.add("org.apache.axis.message.MessageElement []");
  +		    names.add(Constants.ANYCONTENT);
  +		}
  +	    }
  +	}
  +
           // Add attribute names
           if (attributes != null) {
               for (int i = 0; i < attributes.size(); i += 2) {
  @@ -403,6 +421,10 @@
   
           if (isAny) {
               implementsText += ", org.apache.axis.encoding.AnyContentType";
  +        }
  +
  +	if (isMixed) {
  +            implementsText += ", org.apache.axis.encoding.MixedContentType";
           }
   
           implementsText += " ";
  
  
  
  1.1                  ws-axis/java/src/org/apache/axis/encoding/MixedContentType.java
  
  Index: MixedContentType.java
  ===================================================================
  /*
   * Copyright 2001,2004 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.
   */
  
  package org.apache.axis.encoding;
  
  import org.apache.axis.message.MessageElement;
  
  /**
   * Interface to indicate that a bean has mixed content
   *
   */
  public interface MixedContentType {
      public MessageElement[] get_any();
      public void set_any(MessageElement[] any);
  }
      
  
  
  

Mime
View raw message