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 ia...@apache.org on 2003/12/19 09:57:16 UTC
cvs commit: ws-axis/java/src/org/apache/axis/wsdl/symbolTable SchemaUtils.java
ias 2003/12/19 00:57:16
Modified: java/src/org/apache/axis/wsdl/symbolTable SchemaUtils.java
Log:
Fix for Bug 25558 - Added getBaseType(TypeEntry, SymbolTable)
Revision Changes Path
1.32 +26 -0 ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java
Index: SchemaUtils.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- SchemaUtils.java 28 Nov 2003 17:08:13 -0000 1.31
+++ SchemaUtils.java 19 Dec 2003 08:57:16 -0000 1.32
@@ -1750,4 +1750,30 @@
return isSimpleSchemaType(qname.getLocalPart());
}
+
+ /**
+ * Returns the base type of a given type with its symbol table.
+ * This logic is extracted from JavaTypeWriter's constructor() method
+ * for reusing.
+ *
+ * @param type
+ * @param symbolTable
+ * @return
+ */
+ public static TypeEntry getBaseType(TypeEntry type, SymbolTable symbolTable) {
+ Node node = type.getNode();
+ TypeEntry base = getComplexElementExtensionBase(
+ node, symbolTable);
+ if (base == null) {
+ base = getComplexElementRestrictionBase(node, symbolTable);
+ }
+
+ if (base == null) {
+ QName baseQName = getSimpleTypeBase(node);
+ if (baseQName != null) {
+ base = symbolTable.getType(baseQName);
+ }
+ }
+ return base;
+ }
}