Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 90437 invoked from network); 22 Jan 2006 07:01:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jan 2006 07:01:23 -0000 Received: (qmail 38920 invoked by uid 500); 22 Jan 2006 07:01:22 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 38847 invoked by uid 500); 22 Jan 2006 07:01:22 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 38836 invoked by uid 500); 22 Jan 2006 07:01:21 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 38833 invoked by uid 99); 22 Jan 2006 07:01:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jan 2006 23:01:21 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 21 Jan 2006 23:01:21 -0800 Received: (qmail 90184 invoked by uid 65534); 22 Jan 2006 07:01:00 -0000 Message-ID: <20060122070100.90180.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r371222 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema: SchemaCompiler.java template/ADBBeanTemplate.xsl writer/JavaBeanWriter.java Date: Sun, 22 Jan 2006 07:01:00 -0000 To: axis2-cvs@ws.apache.org From: ajith@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ajith Date: Sat Jan 21 23:00:53 2006 New Revision: 371222 URL: http://svn.apache.org/viewcvs?rev=371222&view=rev Log: Made a small fix for the OMElement case. Still needs a bit of fixing in the deserilizer Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=371222&r1=371221&r2=371222&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaCompiler.java Sat Jan 21 23:00:53 2006 @@ -75,6 +75,8 @@ private static final String ANY_ELEMENT_FIELD_NAME = "extraElements"; private static final String EXTRA_ATTRIBUTE_FIELD_NAME = "extraAttributes"; + public static final String DEFAULT_CLASS_NAME = OMElement.class.getName(); + /** * @return the processes element map @@ -324,7 +326,7 @@ //contained schema type. We better set the default then //however it's better if the default can be set through the //property file - className = OMElement.class.getName(); + className = DEFAULT_CLASS_NAME; } if (isArray) { //append the square braces that say this is an array @@ -588,7 +590,7 @@ //we need to put a name here metainf.registerMapping(new QName(ANY_ELEMENT_FIELD_NAME), null, - OMElement.class.getName(), + DEFAULT_CLASS_NAME, SchemaConstants.ANY_TYPE); } Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=371222&r1=371221&r2=371222&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl Sat Jan 21 23:00:53 2006 @@ -145,7 +145,7 @@ if (){ - + elementList.add(new javax.xml.namespace.QName("", "")); elementList.add(); Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=371222&r1=371221&r2=371222&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Sat Jan 21 23:00:53 2006 @@ -3,6 +3,7 @@ import org.apache.axis2.schema.BeanWriterMetaInfoHolder; import org.apache.axis2.schema.CompilerOptions; import org.apache.axis2.schema.SchemaCompilationException; +import org.apache.axis2.schema.SchemaCompiler; import org.apache.axis2.schema.i18n.SchemaCompilerMessages; import org.apache.axis2.schema.util.SchemaPropertyLoader; import org.apache.axis2.util.JavaUtils; @@ -370,7 +371,14 @@ if (javaClassNameForElement == null) { throw new SchemaCompilationException("Type missing!"); } + XSLTUtils.addAttribute(model, "type", javaClassNameForElement, property); + + //add an attribute that says the type is default + if (isDefault(javaClassNameForElement)){ + XSLTUtils.addAttribute(model, "default", "yes", property); + } + if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))) { XSLTUtils.addAttribute(model, "ours", "yes", property); //todo introduce a better name for this } @@ -413,9 +421,18 @@ } ///////////////////////////////////// -// System.out.println("rootElt = " + rootElt); + //System.out.println("rootElt = " + rootElt); ///////////////////////////////////// return rootElt; + } + + /** + * Test whether the given class name matches the default + * @param javaClassNameForElement + * @return + */ + private boolean isDefault(String javaClassNameForElement) { + return SchemaCompiler.DEFAULT_CLASS_NAME.equals(javaClassNameForElement); }