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 he...@apache.org on 2004/06/27 17:16:25 UTC
cvs commit: ws-axis/contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping JaxRpcMapper.java J2eeUtils.java
hemapani 2004/06/27 08:16:25
Modified: contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping
JaxRpcMapper.java J2eeUtils.java
Log:
fix the giving the java type name like JINI types (byte[] wa [B ect ..)
fix it ..temporarly
Revision Changes Path
1.5 +8 -4 ws-axis/contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping/JaxRpcMapper.java
Index: JaxRpcMapper.java
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping/JaxRpcMapper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JaxRpcMapper.java 14 Jun 2004 08:27:53 -0000 1.4
+++ JaxRpcMapper.java 27 Jun 2004 15:16:25 -0000 1.5
@@ -130,13 +130,15 @@
String localPart = typeQName.getLocalPart();
String revisitedTypeQName = typeQName.getNamespaceURI() + ":" + localPart;
if (mappedAnonymousTypeName.equals(revisitedTypeQName)) {
- return typeMapping.getJavaType().getValue();
+ //TODO this is a quick fix there should be a better way to do this
+ return J2eeUtils.jni2javaName(typeMapping.getJavaType().getValue());
}
} else {
QName typeName = rootType.getValue();
if (typeQName.equals(typeName)) {
String className = typeMapping.getJavaType().getValue();
- return className;
+ //TODO this is a quick fix there should be a better way to do this
+ return J2eeUtils.jni2javaName(className);
}
}
}
@@ -262,7 +264,8 @@
MethodParamPartsMappingType paramPart =
(MethodParamPartsMappingType) l.next();
if (paramPart.getParamPosition().getValue().intValue() == position) {
- return paramPart.getParamType().getValue();
+ //TODO this is a quick fix there should be a better way to do this
+ return J2eeUtils.jni2javaName(paramPart.getParamType().getValue());
}
}
}
@@ -306,7 +309,8 @@
WsdlReturnValueMappingType returnValueMapping =
methodMapping.getWsdlReturnValueMapping();
if (returnValueMapping != null) {
- return returnValueMapping.getMethodReturnValue().getValue();
+ //TODO this is a quick fix there should be a better way to do this
+ return J2eeUtils.jni2javaName(returnValueMapping.getMethodReturnValue().getValue());
}
}
}
1.4 +37 -0 ws-axis/contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping/J2eeUtils.java
Index: J2eeUtils.java
===================================================================
RCS file: /home/cvs/ws-axis/contrib/ews/src/org/apache/geronimo/ews/jaxrpcmapping/J2eeUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- J2eeUtils.java 22 Jun 2004 09:13:43 -0000 1.3
+++ J2eeUtils.java 27 Jun 2004 15:16:25 -0000 1.4
@@ -81,5 +81,42 @@
}
return beforeBracket + convertedBrackets;
}
+
+ public static String jni2javaName(String returnType){
+ if(returnType == null)
+ return null;
+ if(!returnType.startsWith("[")){
+ return returnType;
+ }else{
+ returnType = returnType.substring(1);
+ }
+
+ String end = "[]";
+ while(returnType.startsWith("[")){
+ end = end + "[]";
+ returnType = returnType.substring(1);
+ }
+
+ if(returnType.startsWith("B")){
+ returnType = "byte";
+ }else if(returnType.startsWith("I")){
+ returnType = "int";
+ }else if(returnType.startsWith("D")){
+ returnType = "double";
+ }else if(returnType.startsWith("J")){
+ returnType = "long";
+ }else if(returnType.startsWith("Z")){
+ returnType = "boolean";
+ }else if(returnType.startsWith("F")){
+ returnType = "float";
+ }else if(returnType.startsWith("S")){
+ returnType = "short";
+ }else if(returnType.startsWith("L")){
+ int index = returnType.indexOf(";@");
+ returnType.substring(1,index);
+ }
+ return returnType + end;
+ }
+
}