Author: amilas
Date: Tue Jan 4 10:06:59 2011
New Revision: 1054950
URL: http://svn.apache.org/viewvc?rev=1054950&view=rev
Log:
use a map to keep the element qname and class name to support inheritance. see
the issue AXIS2-4818
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=1054950&r1=1054949&r2=1054950&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Tue Jan 4 10:06:59 2011
@@ -168,9 +168,24 @@ public class DefaultSchemaGenerator impl
if ((generateWrappedArrayTypes != null) &&
JavaUtils.isTrue(generateWrappedArrayTypes.getValue())){
isGenerateWrappedArrayTypes = true;
}
+
+ Parameter extraClassesParam = service.getParameter("extraClass");
+ if (extraClassesParam != null){
+ String extraClassesString = (String)
extraClassesParam.getValue();
+ String[] extraClassesArray = extraClassesString.split(",");
+ if (this.extraClasses == null){
+ this.extraClasses = new ArrayList<String>();
+ }
+
+ for (String extraClass : extraClassesArray){
+ this.extraClasses.add(extraClass);
+ }
+ }
}
+
+
}
//This will locad the custom schema file and add that into the schema map
@@ -569,6 +584,8 @@ public class DefaultSchemaGenerator impl
// adding this type's package to the table, to support inheritance.
typeTable.addComplexSchema(getQualifiedName(javaType.getPackage()),
eltOuter.getQName());
+ typeTable.addClassNameForQName(eltOuter.getQName(), name);
+
BeanExcludeInfo beanExcludeInfo = null;
if (service.getExcludeInfo() != null) {
beanExcludeInfo =
service.getExcludeInfo().getBeanExcludeInfoForClass(getClassName(javaType));
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java?rev=1054950&r1=1054949&r2=1054950&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
Tue Jan 4 10:06:59 2011
@@ -28,6 +28,7 @@ import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Vector;
+import java.util.concurrent.ConcurrentHashMap;
public class TypeTable {
@@ -36,10 +37,16 @@ public class TypeTable {
private HashMap complexTypeMap;
+ /**
+ * this map is used to keep the class names with the Qnames.
+ */
+ private Map<QName, String> qNameToClassMap;
+
public TypeTable() {
//complex type table is resetted every time this is
//instantiated
complexTypeMap = new HashMap();
+ this.qNameToClassMap = new HashMap();
}
/* statically populate the simple type map - this is not likely to
@@ -188,6 +195,14 @@ public class TypeTable {
return (QName) complexTypeMap.get(name);
}
+ public String getClassNameForQName(QName qname) {
+ return this.qNameToClassMap.get(qname);
+ }
+
+ public void addClassNameForQName(QName qname, String className) {
+ this.qNameToClassMap.put(qname, className);
+ }
+
/**
* Get the qname for a type
* first try the simple types if not try the complex types