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 na...@apache.org on 2006/11/20 08:07:35 UTC
svn commit: r477083 -
/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
Author: nadiramra
Date: Sun Nov 19 23:07:34 2006
New Revision: 477083
URL: http://svn.apache.org/viewvc?view=rev&rev=477083
Log:
code formatting...
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?view=diff&rev=477083&r1=477082&r2=477083
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java Sun Nov 19 23:07:34 2006
@@ -139,9 +139,8 @@
int anyCounter = 0;
if (type.isArray())
- {
return;
- }
+
try
{
for (int i = 0; i < attribs.length; i++)
@@ -158,18 +157,15 @@
String localMethodName = methodName.substring( 0, methodName.length() - 1);
if( localMethodName.equals( classname))
- {
methodName = localMethodName;
- }
}
if (attribs[i].isArray())
{
String parameterTypeName = properParamName;
if (!parameterTypeName.endsWith("*"))
- {
parameterTypeName += " *";
- }
+
writer.write("\n" + parameterTypeName + " " + classname
+ "::get" + methodName + "()\n{\n");
@@ -189,20 +185,15 @@
writer.write("\t\t" + parameterName + " = new " + type + "_Array();\n");
}
else
- {
writer.write("\t\t" + parameterName + " = new " + properParamName + "();\n");
- }
writer.write("\t}\n");
if (attribs[i].getChoiceElement() || attribs[i].getAllElement())
- {
writer.write("\t" + parameterName + "->clone( *pInValue);\n");
- }
else
- {
writer.write("\t" + parameterName + "->clone( *pInValue);\n");
- }
+
writer.write("}\n");
}
else if (isElementNillable(i) || isElementOptional(i))
@@ -216,16 +207,16 @@
if(attribs[i].getAllElement() || attribs[i].getChoiceElement() )
{
if (isElementNillable(i))
- {
+ {
writer.write("\n" + properParamName + " * " + classname
+ "::get" + methodName + "()\n{\n");
- }
+ }
else
- {
+ {
writer.write("\n" + properParamName + " " + classname
+ "::get" + methodName + "()\n{\n");
- }
- }
+ }
+ }
else
{
writer.write("\n" + properParamName + " * " + classname
@@ -237,18 +228,18 @@
if(attribs[i].getAllElement() || attribs[i].getChoiceElement())
{
if (isElementNillable(i))
- {
+ {
writer.write("\n" + "void " + classname + "::set"
+ methodName + "(" + properParamName
+ " * pInValue, bool deep)\n{\n");
- }
+ }
else
- {
+ {
writer.write("\n" + "void " + classname + "::set"
+ methodName + "(" + properParamName
+ " pInValue, bool deep)\n{\n");
- }
- }
+ }
+ }
else
{
writer.write("\n" + "void " + classname + "::set"
@@ -272,18 +263,12 @@
if(attribs[i].getAllElement() || attribs[i].getChoiceElement())
{
if (isElementNillable(i))
- {
writer.write("\t\t\t" + parameterName + " = new " + type + "*();\n");
- }
else
- {
writer.write("\t\t\t" + parameterName + " = new " + type + "();\n");
- }
- }
+ }
else
- {
writer.write("\t\t\t" + parameterName + " = new " + properParamName + "();\n");
- }
writer.write("\t\t\t*" + parameterName + " = *pInValue;\n");
writer.write("\t\t}\n");
@@ -327,27 +312,25 @@
methodName = methodName + Integer.toString(anyCounter);
}
- Type attributeType = attribs[i].getType();
- boolean isPointerType = false;
-
- if( attributeType.isRestriction())
- {
- // Find the base type of the restriction.
- attributeType = CUtils.findBaseTypeOfRestriction( attributeType, wscontext);
-
- String attributeTypeAsString = CUtils.getBaseTypeOfRestrictionAsString( attributeType);
-
- if( CUtils.isPointerType( attributeTypeAsString))
- {
- int pointerOffset = properParamName.indexOf("*");
-
- if( pointerOffset > 0)
- {
- properParamName = properParamName.substring( 0, pointerOffset);
- }
- }
- }
-
+ Type attributeType = attribs[i].getType();
+ boolean isPointerType = false;
+
+ if( attributeType.isRestriction())
+ {
+ // Find the base type of the restriction.
+ attributeType = CUtils.findBaseTypeOfRestriction( attributeType, wscontext);
+
+ String attributeTypeAsString = CUtils.getBaseTypeOfRestrictionAsString( attributeType);
+
+ if( CUtils.isPointerType( attributeTypeAsString))
+ {
+ int pointerOffset = properParamName.indexOf("*");
+
+ if( pointerOffset > 0)
+ properParamName = properParamName.substring( 0, pointerOffset);
+ }
+ }
+
writer.write("\n"
+ properParamName + " " + classname + "::get" + methodName
+ "()\n{\n");
@@ -362,22 +345,16 @@
+ "void " + classname + "::set"
+ methodName + "(" + properParamName + " InValue");
-// attributeType = attribs[i].getType();
isPointerType = false;
if (attributeType.isSimpleType())
- {
isPointerType = CUtils.isPointerType(CUtils.getclass4qname(attributeType.getBaseType()));
- }
else
- {
isPointerType = CUtils.isPointerType(getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]));
- }
- if((attribs[i].isSimpleType() || attributeType.isSimpleType()) &&
- (isPointerType || attribs[i].getAllElement() || attribs[i].getChoiceElement()))
- {
+
+ if((attribs[i].isSimpleType() || attributeType.isSimpleType()) &&
+ (isPointerType || attribs[i].getAllElement() || attribs[i].getChoiceElement()))
writer.write(", bool deep");
- }
writer.write(")\n{\n");
@@ -540,73 +517,69 @@
{
repeat = false;
- if( type.isRestriction())
- {
- writer.write("\t// A restricted type (base=" + type.getRestrictionBase() + ") has been found. The following restrictions need to be applied:-\n");
-
- Vector vre = type.getRestrictionEnumeration();
- Vector vrp = type.getRestrictionPattern();
-
- if( vre != null)
- {
- writer.write("\t//\t Enumeration:\n");
-
- for( int j = 0; j < vre.size(); j++)
- {
- writer.write("\t//\t\t " + vre.get( j) + "\n");
- }
- }
-
- if( vrp != null)
- {
- writer.write("\t//\t Pattern:\n");
-
- for( int j = 0; j < vrp.size(); j++)
- {
- writer.write("\t//\t\t " + vrp.get( j) + "\n");
- }
- }
+ if( type.isRestriction())
+ {
+ writer.write("\t// A restricted type (base=" + type.getRestrictionBase() + ") has been found. The following restrictions need to be applied:-\n");
+
+ Vector vre = type.getRestrictionEnumeration();
+ Vector vrp = type.getRestrictionPattern();
+
+ if( vre != null)
+ {
+ writer.write("\t//\t Enumeration:\n");
+
+ for( int j = 0; j < vre.size(); j++)
+ writer.write("\t//\t\t " + vre.get( j) + "\n");
+ }
+
+ if( vrp != null)
+ {
+ writer.write("\t//\t Pattern:\n");
+
+ for( int j = 0; j < vrp.size(); j++)
+ writer.write("\t//\t\t " + vrp.get( j) + "\n");
+ }
- // Locate base type for restricted type
- String base = type.getRestrictionBase();
- String baseType = null;
-
- base = base.substring( base.indexOf( ":") + 1);
- baseType = CUtils.getclass4qname( new QName( WrapperConstants.SCHEMA_NAMESPACE, base));
-
- if( baseType == null)
- {
- Iterator itmt = wscontext.getTypemap().getTypes().iterator();
-
- while( itmt.hasNext())
- {
- Type t = (Type) itmt.next();
-
- if( t.getName().getLocalPart().equals( base))
- {
- type = t;
- repeat = true;
- countdown--;
- break;
- }
- }
- }
- else
- {
- baseType = baseType.substring( baseType.lastIndexOf( "_") + 1);
-
- type.setBaseType( new QName( WrapperConstants.SCHEMA_NAMESPACE, baseType));
-
- ai.setType( type);
-
- forceSimpleType = true;
- }
- }
+ // Locate base type for restricted type
+ String base = type.getRestrictionBase();
+ String baseType = null;
+
+ base = base.substring( base.indexOf( ":") + 1);
+ baseType = CUtils.getclass4qname( new QName( WrapperConstants.SCHEMA_NAMESPACE, base));
+
+ if( baseType == null)
+ {
+ Iterator itmt = wscontext.getTypemap().getTypes().iterator();
+
+ while( itmt.hasNext())
+ {
+ Type t = (Type) itmt.next();
+
+ if( t.getName().getLocalPart().equals( base))
+ {
+ type = t;
+ repeat = true;
+ countdown--;
+ break;
+ }
+ }
+ }
+ else
+ {
+ baseType = baseType.substring( baseType.lastIndexOf( "_") + 1);
+
+ type.setBaseType( new QName( WrapperConstants.SCHEMA_NAMESPACE, baseType));
+
+ ai.setType( type);
+
+ forceSimpleType = true;
+ }
+ }
- if ((ai.isArray() || !(ai.isSimpleType() || ai.getType().isSimpleType())) && !repeat)
- {
- throw new WrapperFault("Error : an attribute is not basic type");
- }
+ if ((ai.isArray() || !(ai.isSimpleType() || ai.getType().isSimpleType())) && !repeat)
+ {
+ throw new WrapperFault("Error : an attribute is not basic type");
+ }
} while( repeat && countdown > 0);
// ^^^ FJP - 17667
@@ -615,31 +588,29 @@
//remove _Ref sufix and _ prefix in SOAP tag name
String soapTagName = ai.getParamName();
if (soapTagName.lastIndexOf("_Ref") > -1)
- {
soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
- }
if (soapTagName.charAt(0) == '_')
- {
soapTagName = soapTagName.substring(1, soapTagName.length());
- }
+
//end remove _Ref sufix and _ prefix in SOAP tag name
- boolean isPointerType = false;
- String basicType = null;
-
- if (!ai.isSimpleType() && type.isSimpleType())
- {
- basicType = CUtils.getclass4qname( type.getBaseType());
-
- String class4QName = CUtils.getclass4qname(type.getBaseType());
-
- isPointerType = CUtils.isPointerType( class4QName);
- }
- else
- {
- basicType = ai.getTypeName();
- isPointerType = CUtils.isPointerType(ai.getTypeName());
- }
+ boolean isPointerType = false;
+ String basicType = null;
+
+ if (!ai.isSimpleType() && type.isSimpleType())
+ {
+ basicType = CUtils.getclass4qname( type.getBaseType());
+
+ String class4QName = CUtils.getclass4qname(type.getBaseType());
+
+ isPointerType = CUtils.isPointerType( class4QName);
+ }
+ else
+ {
+ basicType = ai.getTypeName();
+ isPointerType = CUtils.isPointerType(ai.getTypeName());
+ }
+
if (isPointerType)
{
writer.write("\tif (0 != param->"
@@ -685,9 +656,7 @@
}
if(wscontext.getWrapInfo().getWrapperStyle().equals("document"))
- {
writer.write("\tpSZ->serialize( \">\", 0);\n");
- }
if (extensionBaseAttrib != null)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org