Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 98861 invoked from network); 7 Feb 2011 17:06:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Feb 2011 17:06:40 -0000 Received: (qmail 72162 invoked by uid 500); 7 Feb 2011 17:06:40 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 72043 invoked by uid 500); 7 Feb 2011 17:06:36 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 72036 invoked by uid 99); 7 Feb 2011 17:06:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 17:06:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Feb 2011 17:06:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1F69123889E7; Mon, 7 Feb 2011 17:06:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1068014 - in /cxf/branches/2.3.x-fixes: ./ rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java Date: Mon, 07 Feb 2011 17:06:15 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110207170615.1F69123889E7@eris.apache.org> Author: dkulp Date: Mon Feb 7 17:06:14 2011 New Revision: 1068014 URL: http://svn.apache.org/viewvc?rev=1068014&view=rev Log: Merged revisions 1068011 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1068011 | dkulp | 2011-02-07 11:54:30 -0500 (Mon, 07 Feb 2011) | 2 lines [CXF-3311] Incremental generation for XMLBeans Patch from petekol at mail dot ru applied. ........ Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java Propchange: cxf/branches/2.3.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java?rev=1068014&r1=1068013&r2=1068014&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java (original) +++ cxf/branches/2.3.x-fixes/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java Mon Feb 7 17:06:14 2011 @@ -50,6 +50,7 @@ import org.apache.cxf.tools.common.ToolE import org.apache.cxf.tools.common.model.DefaultValueWriter; import org.apache.cxf.tools.util.ClassCollector; import org.apache.cxf.tools.wsdlto.core.DataBindingProfile; +import org.apache.xmlbeans.SchemaGlobalElement; import org.apache.xmlbeans.SchemaType; import org.apache.xmlbeans.SchemaTypeLoader; import org.apache.xmlbeans.SchemaTypeSystem; @@ -89,6 +90,7 @@ public class XMLBeansToolingDataBinding } SchemaTypeSystem typeSystem; + SchemaTypeLoader typeLoader; Map sourcesToCopyMap = new HashMap(); List errors = new LinkedList(); XmlErrorWatcher errorListener = new XmlErrorWatcher(errors); @@ -137,18 +139,35 @@ public class XMLBeansToolingDataBinding public String getType(QName qn, boolean element) { String ret; if (element) { - ret = typeSystem.findDocumentType(qn).getFullJavaName(); + SchemaType type = typeSystem.findDocumentType(qn); + if (type == null) { + type = typeLoader.findDocumentType(qn); + } + + ret = type.getFullJavaName(); if (ret.contains("$")) { ret = ret.substring(0, ret.indexOf('$')); } return ret; } - ret = typeSystem.findType(qn).getFullJavaName(); + + SchemaType type = typeSystem.findType(qn); + if (type == null) { + type = typeLoader.findType(qn); + } + + ret = type.getFullJavaName(); return ret.replace('$', '.'); } public String getWrappedElementType(QName wrapperElement, QName item) { - SchemaType st = typeSystem.findElement(wrapperElement).getType(); + SchemaGlobalElement elem = typeSystem.findElement(wrapperElement); + + if (elem == null) { + elem = typeLoader.findElement(wrapperElement); + } + + SchemaType st = elem.getType(); SchemaType partType = st.getElementProperty(item).getType(); return XMLBeansSchemaTypeUtils.getNaturalJavaClassName(partType); } @@ -379,6 +398,9 @@ public class XMLBeansToolingDataBinding params.setConfig(BindingConfigImpl.forConfigDocuments(cdocs, javaFiles.toArray(new File[javaFiles.size()]), CodeGenUtil.systemClasspath())); + + typeLoader = loader; + params.setLinkTo(linkTo); params.setOptions(opts); params.setErrorListener(errorListener);