Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 14092 invoked from network); 14 Sep 2006 12:00:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Sep 2006 12:00:53 -0000 Received: (qmail 78271 invoked by uid 500); 14 Sep 2006 12:00:53 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 78209 invoked by uid 500); 14 Sep 2006 12:00:52 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 78200 invoked by uid 99); 14 Sep 2006 12:00:52 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2006 05:00:52 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=jim.ma@iona.com; spf=pass X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: pass (idunn.apache.osuosl.org: domain iona.com designates 63.65.132.112 as permitted sender) Received: from ([63.65.132.112:52411] helo=amereast-smg2.iona.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 73/B0-04605-07449054 for ; Thu, 14 Sep 2006 05:00:49 -0700 Received: from amereast-ems2.IONAGLOBAL.COM ([10.65.6.84]) by amereast-smg2.iona.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k8EBse3B004539; Thu, 14 Sep 2006 07:54:56 -0400 (EDT) Received: from shangrila ([10.129.9.120]) by amereast-ems2.IONAGLOBAL.COM with Microsoft SMTPSVC(5.0.2195.6713); Thu, 14 Sep 2006 08:00:40 -0400 From: "Jim Ma" To: , Subject: RE: svn commit: r443321 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/util/ wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/ wsdl2java/src/main/java/or Date: Thu, 14 Sep 2006 20:00:39 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Importance: Normal In-Reply-To: <20060914114044.41FEC1A981A@eris.apache.org> X-OriginalArrivalTime: 14 Sep 2006 12:00:40.0754 (UTC) FILETIME=[6628B120:01C6D7F5] X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Sorry ! Missed the log message : Fixed the compile enum class generated by jaxb issue =20 > -----Original Message----- > From: ema@apache.org [mailto:ema@apache.org] > Sent: Thursday, September 14, 2006 7:41 PM > To: cxf-commits@incubator.apache.org > Subject: svn commit: r443321 - in /incubator/cxf/trunk/tools: > common/src/main/java/org/apache/cxf/tools/common/ > common/src/main/java/org/apache/cxf/tools/util/ > = wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb > / wsdl2java/src/main/java/org... >=20 >=20 > Author: ema > Date: Thu Sep 14 04:40:41 2006 > New Revision: 443321 >=20 > URL: http://svn.apache.org/viewvc?view=3Drev&rev=3D443321 > Log: > CXF-78 >=20 > Modified: > =20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/common/DataBindingGenerator.java > =20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/util/ProcessorUtil.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/Messages.properties > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/frontend/jaxws/AbstractGenerator.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/Messages.properties > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToJavaProcessor.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToProcessor.java > =20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/internal/ClassNameAllocatorImpl.java >=20 > Modified:=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/common/DataBindingGenerator.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/ > main/java/org/apache/cxf/tools/common/DataBindingGenerator.java?vi > ew=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/common/DataBindingGenerator.java (original) > +++=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/common/DataBindingGenerator.java Thu Sep 14 04:40:41 2006 > @@ -25,9 +25,9 @@ > =20 > import com.sun.tools.xjc.api.Property; > public interface DataBindingGenerator {=20 > - void initialize(ToolContext penv); > + void initialize(ToolContext penv) throws ToolException; > void generate() throws ToolException; > String getType(QName qn, boolean fullName); > - String getJavaType(QName qn, boolean fullName); > + String getJavaType(QName qn, boolean boxify); > List getBlock(Part part); > } >=20 > Modified:=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/util/ProcessorUtil.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/ > main/java/org/apache/cxf/tools/util/ProcessorUtil.java?view=3Ddiff&r > ev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/util/ProcessorUtil.java (original) > +++=20 > incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tool > s/util/ProcessorUtil.java Thu Sep 14 04:40:41 2006 > @@ -41,6 +41,7 @@ > import com.sun.xml.bind.api.JAXBRIContext; > =20 > import org.apache.cxf.helpers.JavaUtils; > +import org.apache.cxf.jaxb.JAXBUtils; > import org.apache.cxf.tools.common.DataBindingGenerator; > import org.apache.cxf.tools.common.ToolConstants; > import org.apache.cxf.tools.common.ToolContext; > @@ -235,21 +236,38 @@ > .get(ToolConstants.BINDING_GENERATOR); > String jtype =3D null; > QName xmlTypeName =3D getElementName(part); > - // if this flag is true , mapping to java Type first; > + if (xmlTypeName =3D=3D null) { > + xmlTypeName =3D part.getTypeName(); > + =20 > + } > + > + // if this flag is true , mapping to java Type first; > // if not found , findd the primitive type : int ,long=20 > // if not found, find in the generated class > =20 > + =20 > if (boxify && dataBindingGenerator !=3D null) { > jtype =3D dataBindingGenerator.getJavaType(xmlTypeName, = true); > }=20 > =20 > if (boxify && dataBindingGenerator =3D=3D null) { > - jtype =3D=20 > BuiltInTypesJavaMappingUtil.getJType(xmlTypeName.getNamespaceURI(), > - =20 > xmlTypeName.getLocalPart()); > + jtype =3D=20 > JAXBUtils.builtInTypeToJavaType(xmlTypeName.getLocalPart()); = > } > + =20 > if (!boxify && dataBindingGenerator !=3D null) { > - jtype =3D dataBindingGenerator.getJavaType(xmlTypeName, = true); > + jtype =3D dataBindingGenerator.getJavaType(xmlTypeName, = false); > + } > + =20 > + if (!boxify && dataBindingGenerator =3D=3D null) { > + Class holderClass =3D=20 > JAXBUtils.holderClass(xmlTypeName.getLocalPart()); > + jtype =3D holderClass =3D=3D null ? null : = holderClass.getName(); > + if (jtype =3D=3D null) { > + jtype =3D=20 > JAXBUtils.builtInTypeToJavaType(xmlTypeName.getLocalPart()); > + } > } > + =20 > + =20 > + =20 > String namespace =3D xmlTypeName.getNamespaceURI(); > String type =3D resolvePartType(part, env, true); > String userPackage =3D env.mapPackageName(namespace); >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXB > = BindErrorListener.java?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java Thu=20 > Sep 14 04:40:41 2006 > @@ -18,10 +18,10 @@ > */ > =20 > package org.apache.cxf.tools.wsdl2java.databindings.jaxb; > - > import com.sun.tools.xjc.api.ErrorListener; > - > import org.apache.cxf.tools.common.ToolContext; > +import org.apache.cxf.tools.common.ToolException; > + > =20 > public class JAXBBindErrorListener implements ErrorListener { > private ToolContext env; > @@ -31,25 +31,16 @@ > } > =20 > public void error(org.xml.sax.SAXParseException exception) { > - if (this.env.isVerbose()) { > - exception.printStackTrace(); > - } else { > - System.err.println("Parsing schema error: \n" +=20 > exception.toString()); > - } > + throw new ToolException(exception.getLocalizedMessage()); > + > } > =20 > public void fatalError(org.xml.sax.SAXParseException exception) { > - if (this.env.isVerbose()) { > - exception.printStackTrace(); > - } else { > - System.err.println("Parsing schema fatal error: \n"=20 > + exception.toString()); > - } > + throw new ToolException(exception.getLocalizedMessage()); > } > =20 > public void info(org.xml.sax.SAXParseException exception) { > - if (this.env.isVerbose()) { > - System.err.println("Parsing schema info: " +=20 > exception.toString()); > - } > + > } > =20 > public void warning(org.xml.sax.SAXParseException exception) { >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXB > BindingGenerator.java?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java Thu=20 > Sep 14 04:40:41 2006 > @@ -20,10 +20,7 @@ > package org.apache.cxf.tools.wsdl2java.databindings.jaxb; > =20 > import java.io.File; > -import java.io.FileInputStream; > -import java.io.FileNotFoundException; > import java.io.IOException; > -import java.io.InputStream; > import java.util.ArrayList; > import java.util.Collection; > import java.util.List; > @@ -35,7 +32,6 @@ > import javax.wsdl.PortType; > import javax.wsdl.extensions.schema.Schema; > import javax.xml.namespace.QName; > -import javax.xml.transform.Result; > import javax.xml.transform.TransformerConfigurationException; > import javax.xml.transform.TransformerException; > import javax.xml.transform.TransformerFactory; > @@ -50,16 +46,11 @@ > import org.xml.sax.InputSource; > =20 > import com.sun.codemodel.JCodeModel; > -import com.sun.tools.xjc.BadCommandLineException; > -import com.sun.tools.xjc.Language; > -import com.sun.tools.xjc.ModelLoader; > -import com.sun.tools.xjc.Options; > import com.sun.tools.xjc.api.Property; > import com.sun.tools.xjc.api.S2JJAXBModel; > import com.sun.tools.xjc.api.TypeAndAnnotation; > import com.sun.tools.xjc.api.XJC; > import com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl; > -import com.sun.tools.xjc.model.Model; > =20 > import org.apache.cxf.common.i18n.Message; > import org.apache.cxf.common.logging.LogUtils; > @@ -78,12 +69,12 @@ > protected S2JJAXBModel rawJaxbModel; > protected S2JJAXBModel rawJaxbModelGenCode; > private boolean nestedJaxbBinding; > - private Model model; > + //private Model model; > private ToolContext env; > private int fileIDX; > =20 > @SuppressWarnings("unchecked") > - public void initialize(ToolContext penv) { > + public void initialize(ToolContext penv) throws ToolException { > env =3D penv; > =20 > SchemaCompilerImpl schemaCompiler =3D=20 > (SchemaCompilerImpl)XJC.createSchemaCompiler(); > @@ -99,6 +90,7 @@ > schemaCompiler.setClassNameAllocator(allocator); > JAXBBindErrorListener listener =3D new = JAXBBindErrorListener(env); > schemaCompiler.setErrorListener(listener); > + =20 > =20 > SchemaCompilerImpl schemaCompilerGenCode =3D schemaCompiler; > String excludePackageName =3D ""; > @@ -109,7 +101,7 @@ > } > List schemaSystemidList =3D new ArrayList(); > =20 > - Options opt =3D new OptionsEx(); > + //Options opt =3D new OptionsEx(); > List schemaList =3D env.getSchemaList(); > for (Schema schema : schemaList) { > =20 > @@ -133,11 +125,14 @@ > systemid =3D schema.getDocumentBaseURI() + "#" +=20 > targetNamespace; > } > schemaSystemidList.add(systemid); > - schemaCompiler.parseSchema(systemid, schemaElement); > - schemaCompilerGenCode.parseSchema(systemid, = schemaElement); > + =20 > if (nestedJaxbBinding) { > - processNestedBinding(schemaElement, systemid, opt); > - > + InputSource ins =3D=20 > processNestedBinding(schemaElement, systemid); > + schemaCompiler.parseSchema(ins); > + schemaCompilerGenCode.parseSchema(ins); > + } else { > + schemaCompiler.parseSchema(systemid, schemaElement); > + schemaCompilerGenCode.parseSchema(systemid,=20 > schemaElement); > } > =20 > } > @@ -149,54 +144,92 @@ > schemaCompilerGenCode.parseSchema(bindingFile); > } > } > - rawJaxbModel =3D schemaCompiler.bind(); > + try { > + rawJaxbModel =3D schemaCompiler.bind(); > + > + } catch (ToolException e) { > + throw e; > + } > if (env.isExcludeNamespaceEnabled()) { > rawJaxbModelGenCode =3D schemaCompilerGenCode.bind(); > } else { > rawJaxbModelGenCode =3D rawJaxbModel; > } > - if (nestedJaxbBinding) { > + =20 > + /*if (nestedJaxbBinding) { > opt.classNameAllocator =3D allocator; > model =3D ModelLoader.load(opt, new JCodeModel(), new=20 > JAXBErrorReceiver(env)); > model.generateCode(opt, new JAXBErrorReceiver(env)); > + } */ =20 > + addedEnumClassToCollector(schemaList, allocator); > + } > + =20 > + =20 > + //Jaxb's bug . Jaxb ClassNameCollecotr may not be invoked=20 > when generated class is an enum. > + //So we need use this method to add the missed file to = classCollector > + =20 > + private void addedEnumClassToCollector(List=20 > schemaList, ClassNameAllocatorImpl allocator) { > + for (Schema schema : schemaList) { > + Element schemaElement =3D schema.getElement(); > + String targetNamespace =3D=20 > schemaElement.getAttribute("targetNamespace"); > + if (StringUtils.isEmpty(targetNamespace)) { > + continue; > + } > + String packageName =3D=20 > ProcessorUtil.parsePackageName(targetNamespace, null); > + if (!addedToClassCollector(packageName)) { > + allocator.assignClassName(packageName, "*"); > + } > } > - > + } > + =20 > + private boolean addedToClassCollector(String packageName) { > + ClassCollector classCollector =3D=20 > (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR); > + List files =3D=20 > (List)classCollector.getGeneratedFileInfo(); > + for (String file : files) { > + int dotIndex =3D file.lastIndexOf("."); > + String sub =3D file.substring(0, dotIndex - 1); > + if (sub.equals(packageName)) { > + return true; > + } > + } > + return false; > + =20 > } > =20 > - private void processNestedBinding(Element schemaElement,=20 > String systemid, Options opt) { > + private InputSource processNestedBinding(Element=20 > schemaElement, String systemid) { > String xsdFile =3D "schema" + (fileIDX++); > File file =3D null; > try { > file =3D File.createTempFile(xsdFile, ".xsd"); > } catch (IOException e) { > - // TODO Auto-generated catch block > e.printStackTrace(); > } > - Result result =3D new StreamResult(file); > + > + StreamResult result =3D new StreamResult(file); > + =20 > DOMSource source =3D new DOMSource(schemaElement); > =20 > try { > =20 > TransformerFactory.newInstance().newTransformer().transform(source > , result); > } catch (TransformerConfigurationException e) { > - // TODO Auto-generated catch block > e.printStackTrace(); > } catch (TransformerException e) { > - // TODO Auto-generated catch block > e.printStackTrace(); > } catch (TransformerFactoryConfigurationError e) { > - // TODO Auto-generated catch block > e.printStackTrace(); > } > + > InputSource insource =3D null; > - try { > - insource =3D new InputSource((InputStream)new=20 > FileInputStream(file)); > - } catch (FileNotFoundException e) { > - // TODO Auto-generated catch block > - e.printStackTrace(); > - } > - insource.setSystemId(systemid); > - opt.setSchemaLanguage(Language.XMLSCHEMA); > - opt.addGrammar(file); > + =20 > + insource =3D new InputSource(result.getSystemId()); > + //insource.setByteStream((InputStream)new=20 > FileInputStream(file)); > + System.err.println(result.getSystemId()); > + // insource.setSystemId(result.getSystemId()); > + =20 > + =20 > + return insource; > + /*opt.setSchemaLanguage(Language.XMLSCHEMA); > + opt.addGrammar(file);*/ > } > =20 > public void generate() throws ToolException { > @@ -211,9 +244,9 @@ > =20 > TypesCodeWriter fileCodeWriter =3D new=20 > TypesCodeWriter(new File(dir), env.getExcludePkgList()); > =20 > - if (rawJaxbModelGenCode instanceof S2JJAXBModel &&=20 > !nestedJaxbBinding) { > + if (rawJaxbModelGenCode instanceof S2JJAXBModel) { > S2JJAXBModel schem2JavaJaxbModel =3D=20 > (S2JJAXBModel)rawJaxbModelGenCode; > - > + =20 > JCodeModel jcodeModel =3D=20 > schem2JavaJaxbModel.generateCode(null, null); > jcodeModel.build(fileCodeWriter); > for (String str : = fileCodeWriter.getExcludeFileList()) { > @@ -221,12 +254,12 @@ > } > } > =20 > - if (rawJaxbModelGenCode instanceof S2JJAXBModel &&=20 > nestedJaxbBinding) { > + /* if (rawJaxbModelGenCode instanceof S2JJAXBModel &&=20 > nestedJaxbBinding) { > model.codeModel.build(fileCodeWriter); > for (String str : = fileCodeWriter.getExcludeFileList()) { > env.getExcludeFileList().add(str); > } > - } > + }*/ > =20 > return; > } catch (IOException e) { > @@ -273,7 +306,7 @@ > if (boxify) { =20 > jtypeClass =3D = jtype.getTypeClass().boxify().fullName(); > } else { > - jtypeClass =3D jtype.getTypeClass().name(); > + jtypeClass =3D jtype.getTypeClass().fullName(); > } > } > =20 > @@ -351,7 +384,7 @@ > return new ArrayList(); > } > =20 > - private class OptionsEx extends Options { > + /*private class OptionsEx extends Options { > =20 > protected Mode mode =3D Mode.CODE; > =20 > @@ -359,10 +392,10 @@ > =20 > return super.parseArgument(args, i); > } > - } > + }*/ > =20 > - private enum Mode { > + /* private enum Mode { > CODE, BGM, SIGNATURE, FOREST, DRYRUN, ZIP, > - } > + }*/ > =20 > } >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/Messages.properties > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Mess > ages.properties?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/Messages.properties (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/databindings/jaxb/Messages.properties Thu Sep 14=20 > 04:40:41 2006 > @@ -1,3 +1,4 @@ > +GENERATE_TYPES_ERROR =3D Generate types error > FAIL_TO_GENERATE_TYPES =3D Fail to generate types > =20 > =20 >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/frontend/jaxws/AbstractGenerator.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Abstrac > tGenerator.java?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/frontend/jaxws/AbstractGenerator.java (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/frontend/jaxws/AbstractGenerator.java Thu Sep 14=20 > 04:40:41 2006 > @@ -109,6 +109,11 @@ > =20 > protected Writer parseOutputName(String packageName, String=20 > filename) throws ToolException { > ClassCollector collector =3D=20 > (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR); > + =20 > + if (ToolConstants.SEI_GENERATOR.equals(name)) { > + collector.addSeiClassName(packageName , filename ,=20 > packageName + "." + filename); > + } > + =20 > if (ToolConstants.CLT_GENERATOR.equals(name)) { > collector.addClientClassName(packageName , filename=20 > , packageName + "." + filename); > } >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/Messages.properties > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/processor/Messages.pro > perties?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/Messages.properties (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/Messages.properties Thu Sep 14 04:40:41 2006 > @@ -6,7 +6,7 @@ > WRAPPER_STYLE_TWO_RETURN_TYPES =3D Wrapper style can not have two=20 > return types > CANNOT_FIND_WSDL =3D Can not find the wsdl from : {0} > BINDING_SPECIFY_ONE_PROTOCOL =3D Binding : {0} must specify one = protocol > -FAIL_TO_CREATE_DATABINDING_MODEL =3D File to create databinding model > +FAIL_TO_CREATE_DATABINDING_MODEL =3D Fail to create databinding model = : {0} > =20 > FAIL_TO_COMPILE_GENERATE_CODES =3D Fail to compile generated code > FAIL_TO_COPY_GENERATED_RESOURCE_FILE =3D Fail to copy generated=20 > resource file >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToJavaProcessor.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s > rc/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaPr > ocessor.java?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > ---=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToJavaProcessor.java (original) > +++=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToJavaProcessor.java Thu Sep 14 04:40:41 = 2006 > @@ -248,13 +248,14 @@ > } > =20 > String outPutDir =3D = (String)env.get(ToolConstants.CFG_OUTPUTDIR); > - > + =20 > Set dirSet =3D new HashSet(); > Iterator ite =3D = classCollector.getGeneratedFileInfo().iterator(); > while (ite.hasNext()) { > String fileName =3D (String)ite.next(); > fileName =3D fileName.replace('.', File.separatorChar); > String dirName =3D fileName.substring(0,=20 > fileName.lastIndexOf(File.separator) + 1); > + =20 > String path =3D outPutDir + File.separator + dirName; > if (!dirSet.contains(path)) { > =20 > @@ -282,6 +283,11 @@ > } > =20 > } > + //Jaxb's bug . Jaxb ClassNameCollecotr may not be=20 > invoked when generated class is an enum. > + //So we need recheck whether we add all generated source=20 > files to fileList > + =20 > + =20 > + =20 > =20 > String[] arguments =3D new String[argList.size() +=20 > fileList.size() + 1]; > arguments[0] =3D "javac"; > @@ -294,7 +300,6 @@ > =20 > for (Object o : fileList.toArray()) { > String file =3D (String)o; > - > arguments[i] =3D file; > i++; > } >=20 > Modified:=20 > incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/t > ools/wsdl2java/processor/WSDLToProcessor.java > URL:=20 > http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/s rc/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.jav= a?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- = incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/ws= dl2java/processor/WSDLToProcessor.java (original) +++ = incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/ws= dl2java/processor/WSDLToProcessor.java Thu Sep 14 04:40:41 2006 @@ -262,7 +262,7 @@ } catch (Exception e) { org.apache.cxf.common.i18n.Message msg =3D new = org.apache.cxf.common.i18n.Message("FAIL_TO_CREATE_DATABINDING_MODEL", - LOG); + LOG, new = Object[] {e.getLocalizedMessage()}); LOG.log(Level.SEVERE, msg.toString()); throw new ToolException(msg, e); } @@ -318,6 +318,7 @@ =20 @SuppressWarnings("unchecked") private void addSchema(Schema schema) { + =20 Map imports =3D schema.getImports(); if (imports !=3D null && imports.size() > 0) { Collection importKeys =3D imports.keySet(); Modified: = incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/ws= dl2java/processor/internal/ClassNameAllocatorImpl.java URL: = http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main= /java/org/apache/cxf/tools/wsdl2java/processor/internal/ClassNameAllocato= rImpl.java?view=3Ddiff&rev=3D443321&r1=3D443320&r2=3D443321 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- = incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/ws= dl2java/processor/internal/ClassNameAllocatorImpl.java (original) +++ = incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/ws= dl2java/processor/internal/ClassNameAllocatorImpl.java Thu Sep 14 = 04:40:41 2006 @@ -45,7 +45,6 @@ if (isNameCollision(packageName, className)) { fullClzName =3D className + TYPE_SUFFIX; } - collector.addTypesClassName(packageName, className, packageName = + "." + fullClzName); return fullClzName; }