axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanj...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp ParamWriter.java
Date Thu, 01 Jan 2004 07:08:30 GMT
sanjaya     2003/12/31 23:08:30

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp Tag:
                        CWrapperSupport ParamWriter.java
  Log:
  1.changes to accomodate the signature changes of Type.getElementnames
  and Type.getAttributeNames
  2. Added intAttrFieldSz and intEleFieldSz to improve the for loops in getAttribList()
  3.changed the check for array/complex/simple types to use TypeMap.isSimpleType in getCorrectParmNameConsideringArraysAndComplexTypes
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.3.4.3   +15 -11    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamWriter.java
  
  Index: ParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamWriter.java,v
  retrieving revision 1.3.4.2
  retrieving revision 1.3.4.3
  diff -u -r1.3.4.2 -r1.3.4.3
  --- ParamWriter.java	16 Dec 2003 10:37:16 -0000	1.3.4.2
  +++ ParamWriter.java	1 Jan 2004 07:08:30 -0000	1.3.4.3
  @@ -67,12 +67,14 @@
   import java.io.IOException;
   import java.util.ArrayList;
   import java.util.Enumeration;
  +import java.util.Iterator;
   
   import javax.xml.namespace.QName;
   
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
   import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
   import org.apache.axis.wsdl.wsdl2ws.info.Type;
  +import org.apache.axis.wsdl.wsdl2ws.info.TypeMap;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
   public abstract class ParamWriter extends BasicFileWriter{
  @@ -114,21 +116,23 @@
   		ArrayList attribfeilds = new ArrayList();
   		ArrayList elementfeilds = new ArrayList();
   
  -		Enumeration names = type.getAttributeNames();
  -		while (names.hasMoreElements()){
  -			attribfeilds.add(names.nextElement());
  +		Iterator names = type.getAttributeNames();
  +		while (names.hasNext()){
  +			attribfeilds.add(names.next());
   		}
           
   		names = type.getElementnames();
  -				while (names.hasMoreElements()){
  -					elementfeilds.add(names.nextElement());
  +				while (names.hasNext()){
  +					elementfeilds.add(names.next());
   		}
           
           
   		//get all the fields
  -  
  -		attribs = new String[attribfeilds.size()+elementfeilds.size()][];
  -		for (int i = 0; i < attribfeilds.size(); i++) {
  +		int intAttrFieldSz = attribfeilds.size();
  +		int intEleFieldSz = elementfeilds.size();
  +		attribs = new String[intAttrFieldSz+intEleFieldSz][];
  +
  +		for (int i = 0 ; i < intAttrFieldSz; i++) {
   			//[variablename,typename,typeQNameURI,typeQNamelocalpart,attributeTypeURI,attributeTypeLocalpart]
   			attribs[i] = new String[6];
   			attribs[i][0] = ((String) attribfeilds.get(i));
  @@ -146,8 +150,8 @@
   			attribs[i][4] = null;
   			attribs[i][5] = null;
   		}
  -        
  -		for (int i = attribfeilds.size(); i < elementfeilds.size()+attribfeilds.size(); i++)
{
  +
  +		for (int i = intAttrFieldSz ; i < intAttrFieldSz+intEleFieldSz; i++) {
   			attribs[i] = new String[6];
   			attribs[i][0] = ((String) elementfeilds.get(i));
      
  @@ -177,7 +181,7 @@
    	protected String getCorrectParmNameConsideringArraysAndComplexTypes(QName name,String
classname)throws WrapperFault{
   		//System.out.println(name);
   		Type t = wscontext.getTypemap().getType(name);
  -		if(t !=null){ //array or complex types
  +		if(!TypeMap.isSimpleType(name)){ //array or complex types
   			if (t.isArray()){
   				return t.getLanguageSpecificName();
   			}
  
  
  

Mime
View raw message