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/07/08 23:08:48 UTC
svn commit: r420190 -
/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java
Author: nadiramra
Date: Sat Jul 8 14:08:48 2006
New Revision: 420190
URL: http://svn.apache.org/viewvc?rev=420190&view=rev
Log:
Stage 1: Infrastructure to handle generation of unique names in order to better handle the
generation of anonymous type.
Modified:
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java?rev=420190&r1=420189&r2=420190&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java Sat Jul 8 14:08:48 2006
@@ -97,7 +97,29 @@
/* Should this type be generated or not */
/* this value is currently only used in limited places. usually we use the ">" symbol */
private boolean generated;
-
+
+ /* Is anonymous type? qname.localname is checked, and if starts with '>', then true */
+ private boolean isAnonymous = false;
+
+ /* Has type been exposed - only valid for anonymous types */
+ private boolean anonymousTypeExposed = false;
+
+ public boolean isAnonymous()
+ {
+ return isAnonymous;
+ }
+
+ public void exposeAnonymousType()
+ {
+ // Exposing anonymous type means removing starting '>' characters.
+ if (isAnonymous && !anonymousTypeExposed)
+ {
+ languageSpecificName = CUtils.getUniqueName(languageSpecificName);
+
+ name = new QName(name.getNamespaceURI(), languageSpecificName);
+ anonymousTypeExposed = true;
+ }
+ }
public Type(QName name, String languageSpecificName, boolean hasOrder, String language)
@@ -126,7 +148,7 @@
this.languageSpecificName = TypeMap.getBasicTypeClass4qname(name);
}
- //if it is not a simple type genarate the name using usual QName -> language specific name mapping
+ //if it is not a simple type try name using usual QName -> language specific name mapping
if (this.languageSpecificName == null)
this.languageSpecificName = qname2LSN();
else
@@ -150,8 +172,12 @@
this.languageSpecificName.replaceAll(">", "_");
}
}
- }
+ }
+ // Indicate whether type is anonymous. Anonymous type start with '>'.
+ if (this.languageSpecificName.charAt(0) == '>')
+ isAnonymous = true;
+
this.attribOrder = new Vector();
if (name.getNamespaceURI().equals(WrapperConstants.APACHE_XMLSOAP_NAMESPACE) &&
@@ -448,6 +474,7 @@
}
else
{
+ str = str + "isAnonymous =" + isAnonymous + "\n";
str = str + "isArray =" + isArray + "\n";
str = str + "Elements[\n";
Iterator c = elements.values().iterator();
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org