cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r487441 [2/3] - in /incubator/cxf/trunk: ./ rt/core/src/main/java/org/apache/cxf/wsdl/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/core/src/test/java/org/apache/cxf/wsdl11/ tools/common/src/main/java/org/apache/cxf/tools/common/ tools/c...
Date Fri, 15 Dec 2006 03:40:17 GMT
Added: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,341 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.core;
+
+import java.io.*;
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.tools.common.Processor;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.plugin.DataBinding;
+import org.apache.cxf.tools.plugin.FrontEnd;
+import org.apache.cxf.tools.plugin.Generator;
+import org.apache.cxf.tools.plugin.Plugin;
+
+public final class PluginLoader {
+    public static final Logger LOG = LogUtils.getL7dLogger(PluginLoader.class);
+    private static PluginLoader pluginLoader;
+    private static final String DEFAULT_PLUGIN = "/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml";
+    
+    private Map<String, Plugin> plugins = new LinkedHashMap<String, Plugin>();
+
+    private Map<String, FrontEnd> frontends = new LinkedHashMap<String, FrontEnd>();
+    private Map<String, FrontEndProfile> frontendProfiles = new LinkedHashMap<String, FrontEndProfile>();
+    
+    private Map<String, DataBinding> databindings = new LinkedHashMap<String, DataBinding>();
+    private Map<String, DataBindingProfile> databindingProfiles
+        = new LinkedHashMap<String, DataBindingProfile>();
+
+    private Unmarshaller unmarshaller;
+    
+    private PluginLoader() {
+        try {
+            JAXBContext jc = JAXBContext.newInstance("org.apache.cxf.tools.plugin");
+            unmarshaller = jc.createUnmarshaller();
+        } catch (JAXBException e) {
+            LOG.log(Level.SEVERE, "JAXB_CONTEXT_INIT_FAIL");
+            Message msg = new Message("JAXB_CONTEXT_INIT_FAIL", LOG);
+            throw new ToolException(msg);            
+        }
+
+        loadPlugin(DEFAULT_PLUGIN);
+    }
+
+    public static PluginLoader getInstance() {
+        if (pluginLoader == null) {
+            pluginLoader = new PluginLoader();
+        }
+        return pluginLoader;
+    }
+
+    public void loadPlugin(String resource) {
+        try {
+            LOG.log(Level.INFO, "PLUGIN_LOADING", resource);
+            loadPlugin(getPlugin(resource));
+        } catch (JAXBException e) {
+            LOG.log(Level.SEVERE, "PLUGIN_LOAD_FAIL", resource);
+            Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, resource);
+            throw new ToolException(msg, e);
+        }
+    }
+    
+    protected void loadPlugin(Plugin plugin) {
+        LOG.log(Level.INFO, "FOUND_FRONTENDS", new Object[]{plugin.getName(), plugin.getFrontend().size()});
+        for (FrontEnd frontend : plugin.getFrontend()) {
+            LOG.log(Level.INFO, "LOADING_FRONTEND", new Object[]{frontend.getName(), plugin.getName()});
+            if (StringUtils.isEmpty(frontend.getName())) {
+                LOG.log(Level.WARNING, "FRONTEND_MISSING_NAME", plugin.getName());
+                continue;
+            }
+            frontends.put(frontend.getName(), frontend);
+        }
+        
+        LOG.log(Level.INFO, "FOUND_DATABINDINGS", new Object[]{plugin.getName(),
+                                                               plugin.getDatabinding().size()});
+        for (DataBinding databinding : plugin.getDatabinding()) {
+            LOG.log(Level.INFO, "LOADING_DATABINDING", new Object[]{databinding.getName(), plugin.getName()});
+            if (StringUtils.isEmpty(databinding.getName())) {
+                LOG.log(Level.WARNING, "DATABINDING_MISSING_NAME", plugin.getName());
+                continue;
+            }
+            databindings.put(databinding.getName(), databinding);
+        }
+    }
+
+    protected Plugin getPlugin(String resource) throws JAXBException {
+        Plugin plugin = plugins.get(resource);
+        if (plugin == null) {
+            InputStream is = getClass().getResourceAsStream(resource);
+            if (is == null) {
+                LOG.log(Level.SEVERE, "PLUGIN_MISSING", resource);
+                Message msg = new Message("PLUGIN_MISSING", LOG, resource);
+                throw new ToolException(msg);
+            }
+            plugin = getPlugin(is);
+            if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
+                LOG.log(Level.SEVERE, "PLUGIN_LOAD_FAIL", resource);
+                Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, resource);
+                throw new ToolException(msg);
+            }
+            plugins.put(resource, plugin);
+        }
+        return plugin;
+    }
+
+    private Plugin getPlugin(InputStream is) throws JAXBException {
+        // TODO: schema validation
+        return (Plugin) ((JAXBElement<?>)unmarshaller.unmarshal(is)).getValue();
+    }
+
+    public FrontEnd getFrontEnd(String name) {
+        FrontEnd frontend = frontends.get(name);
+        if (frontend == null) {
+            // TODO: If null, we should search the whole classpath, to load all the plugins,
+            //       otherwise throws Exception
+            Message msg = new Message("FRONTEND_MISSING", LOG, name);
+            throw new ToolException(msg);
+        }
+        return frontend;
+    }
+
+    private String getGeneratorClass(FrontEnd frontend, Generator generator) {
+        String fullPackage = generator.getPackage();
+        if (StringUtils.isEmpty(fullPackage)) {
+            fullPackage = frontend.getGenerators().getPackage();
+        }
+        if (StringUtils.isEmpty(fullPackage)) {
+            fullPackage = frontend.getPackage();
+        }
+        return fullPackage + "." + generator.getName();
+    }
+    
+    private List<FrontEndGenerator> getFrontEndGenerators(FrontEnd frontend) {
+        List<FrontEndGenerator> generators = new ArrayList<FrontEndGenerator>();
+
+        String fullClzName = null;
+        try {
+            for (Generator generator : frontend.getGenerators().getGenerator()) {
+                fullClzName = getGeneratorClass(frontend, generator);
+                generators.add((FrontEndGenerator)Class.forName(fullClzName).newInstance());
+            }
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "FRONTEND_PROFILE_LOAD_FAIL", fullClzName);
+            Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);
+            throw new ToolException(msg, e);
+        }
+        return generators;
+    }
+
+    private FrontEndProfile loadFrontEndProfile(String fullClzName) {
+        FrontEndProfile profile = null;
+        try {
+            profile = (FrontEndProfile) Class.forName(fullClzName).newInstance();
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "FRONTEND_PROFILE_LOAD_FAIL", fullClzName);
+            Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);
+            throw new ToolException(msg, e);
+        }
+        return profile;
+    }
+
+    private Processor loadProcessor(String fullClzName) {
+        Processor processor = null;
+        try {
+            processor = (Processor) Class.forName(fullClzName).newInstance();
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "LOAD_PROCESSOR_FAILED", fullClzName);
+            Message msg = new Message("LOAD_PROCESSOR_FAILED", LOG, fullClzName);
+            throw new ToolException(msg, e);
+        }
+        return processor;
+    }
+
+    private Class loadContainerClass(String fullClzName) {
+        Class clz = null;
+        try {
+            clz = Class.forName(fullClzName);
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "LOAD_CONTAINER_CLASS_FAILED", fullClzName);
+            Message msg = new Message("LOAD_CONTAINER_CLASS_FAILED", LOG, fullClzName);
+            throw new ToolException(msg, e);
+        }
+        return clz;
+    }
+
+    private String getFrontEndProfileClass(FrontEnd frontend) {
+        if (StringUtils.isEmpty(frontend.getProfile())) {
+            return "org.apache.cxf.tools.wsdlto.core.FrontEndProfile";
+        }
+        return frontend.getPackage() + "." + frontend.getProfile();
+    }
+
+    private String getProcessorClass(FrontEnd frontend) {
+        String pkgName = frontend.getProcessor().getPackage();
+        if (StringUtils.isEmpty(pkgName)) {
+            pkgName = frontend.getPackage();
+        }
+        return pkgName + "." + frontend.getProcessor().getName();
+    }
+
+    private String getContainerClass(FrontEnd frontend) {
+        return getContainerPackage(frontend) + "." + frontend.getContainer().getName();
+    }
+    
+    private String getContainerPackage(FrontEnd frontend) {
+        String pkgName = frontend.getContainer().getPackage();
+        if (StringUtils.isEmpty(pkgName)) {
+            pkgName = frontend.getPackage();
+        }
+        return pkgName;
+    }
+
+    private String getToolspec(FrontEnd frontend) {
+        String toolspec = frontend.getContainer().getToolspec();
+        return "/" + getContainerPackage(frontend).replace(".", "/") + "/" + toolspec;
+    }
+
+    private AbstractWSDLBuilder loadBuilder(String fullClzName) {
+        AbstractWSDLBuilder builder = null;
+        try {
+            builder = (AbstractWSDLBuilder) Class.forName(fullClzName).newInstance();
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "LOAD_PROCESSOR_FAILED", fullClzName);
+            Message msg = new Message("LOAD_PROCESSOR_FAILED", LOG, fullClzName);
+            throw new ToolException(msg, e);
+        }
+        return builder;
+    }
+
+    private String getBuilderClass(FrontEnd frontend) {
+        String pkgName = frontend.getBuilder().getPackage();
+        if (StringUtils.isEmpty(pkgName)) {
+            pkgName = frontend.getPackage();
+        }
+        return pkgName + "." + frontend.getBuilder().getName();
+    }
+
+    public FrontEndProfile getFrontEndProfile(String name) {
+        FrontEndProfile profile = frontendProfiles.get(name);
+        if (profile == null) {
+            FrontEnd frontend = getFrontEnd(name);
+            profile = loadFrontEndProfile(getFrontEndProfileClass(frontend));
+
+            for (FrontEndGenerator generator : getFrontEndGenerators(frontend)) {
+                profile.registerGenerator(generator);
+            }
+            
+            if (frontend.getProcessor() != null) {
+                profile.setProcessor(loadProcessor(getProcessorClass(frontend)));
+            }
+            if (frontend.getContainer() != null) {
+                profile.setContainerClass(loadContainerClass(getContainerClass(frontend)));
+                profile.setToolspec(getToolspec(frontend));
+            }
+            if (frontend.getBuilder() != null) {
+                profile.setWSDLBuilder(loadBuilder(getBuilderClass(frontend)));
+            }
+            
+            
+            frontendProfiles.put(name, profile);
+        }
+        return profile;
+    }
+
+    public DataBinding getDataBinding(String name) {
+        DataBinding databinding = databindings.get(name);
+        if (databinding == null) {
+            // TODO: If null, we should search the whole classpath, to load all the plugins,
+            //       otherwise throws Exception
+            Message msg = new Message("DATABINDING_MISSING", LOG, name);
+            throw new ToolException(msg);            
+        }
+        return databinding;
+    }
+
+    private DataBindingProfile loadDataBindingProfile(String fullClzName) {
+        DataBindingProfile profile = null;
+        try {
+            profile = (DataBindingProfile) Class.forName(fullClzName).newInstance();
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE, "DATABINDING_PROFILE_LOAD_FAIL", fullClzName);
+            Message msg = new Message("DATABINDING_PROFILE_LOAD_FAIL", LOG, fullClzName);
+            throw new ToolException(msg);                
+        }
+        return profile;
+    }
+    
+    public DataBindingProfile getDataBindingProfile(String name) {
+        DataBindingProfile profile = databindingProfiles.get(name);
+        if (profile == null) {
+            DataBinding databinding = getDataBinding(name);
+            profile = loadDataBindingProfile(databinding.getPackage() + "." + databinding.getProfile());
+            databindingProfiles.put(name, profile);
+        }
+        return profile;
+    }
+
+    public Plugin findPlugin() {
+        // TODO: find and load the plugin from the classpath
+        return null;
+    }
+
+    public Map<String, FrontEnd> getFrontEnds() {
+        return this.frontends;
+    }
+
+    public Map<String, DataBinding> getDataBindings() {
+        return this.databindings;
+    }
+
+    public Map<String, Plugin> getPlugins() {
+        return this.plugins;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<plugin name="default" version="" provider="" xmlns="http://cxf.apache.org/tools/plugin">
+    <frontend name="" package="" profile="">
+	<generators>
+	    <generator name=""/>
+	</generators>
+    </frontend>	
+    <databinding name="" package="" profile=""/>
+</plugin>
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/cxf-tools-plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml (from r485994, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/wsdl2java.xml)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml?view=diff&rev=487441&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/wsdl2java.xml&r1=485994&p2=incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml&r2=487441
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/wsdl2java.xml (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/wsdlto.xml Thu Dec 14 19:40:13 2006
@@ -1,21 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
- 
-  http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
 <toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	  xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict"
@@ -24,42 +24,61 @@
 	  xmlns:ts="http://www.xsume.com/Xutil/ToolSpecification">
 
     <annotation>
-Examples :
+	Examples :
 
-wsdl2java HelloWorld.wsdl
-wsdl2java -p com.iona.greeting Greeting.wsdl
-wsdl2java -client HelloWorld.wsdl
+	wsdl2java HelloWorld.wsdl
+	wsdl2java -p com.iona.greeting Greeting.wsdl
+	wsdl2java -client HelloWorld.wsdl
     </annotation>
 
     <usage>
 	<optionGroup id="options">
+	    <option id="frontend" maxOccurs="1">
+		<annotation>Specify the frontend name</annotation>
+		<switch>fe</switch>
+		<switch>frontend</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>name of the front end (default use jaxws)</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="databinding" maxOccurs="1">
+		<annotation>Specify the databinding name</annotation>
+		<switch>db</switch>
+		<switch>databinding</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>name of the data binding (default use jaxb)</annotation>
+		</associatedArgument>
+	    </option>
+
 	    <option id="packagename" maxOccurs="unbounded">
 		<annotation>
-		            The java package name to use for the generated code.
-		            Also, optionally specify the wsdl namespace mapping 
-		            to a particular java packagename.
+		    The java package name to use for the generated code.
+		    Also, optionally specify the wsdl namespace mapping 
+		    to a particular java packagename.
 		</annotation>
 		<switch>p</switch>
 		<associatedArgument placement="afterSpace">
-			<valuetype>NamingSpacePackageString</valuetype>
-		<annotation>[wsdl namespace =]Package Name</annotation>
+		    <valuetype>NamingSpacePackageString</valuetype>
+		    <annotation>[wsdl namespace =]Package Name</annotation>
 		</associatedArgument>
 	    </option>
 
+	    <!--
 	    <option id="binding" maxOccurs="unbounded">
 		<annotation>
-		            Specify external jaxws or jaxb binding files, (Each 
-		            file must have its own -b)
+		    Specify external jaxws or jaxb binding files, (Each 
+		    file must have its own -b)
 		</annotation>
 		<switch>b</switch>
 		<associatedArgument placement="afterSpace">
 		    <annotation>binding-name</annotation>
 		</associatedArgument>
 	    </option>
+	    -->
 
 	    <option id="outputdir" maxOccurs="1">
-		<annotation>
-		            The directory in which the code is placed</annotation>
+		<annotation>The directory in which the code is placed</annotation>
 		<switch>d</switch>
 		<associatedArgument placement="afterSpace">
 		    <annotation>output-directory</annotation>
@@ -67,140 +86,132 @@
 	    </option>
 	    
 	    <option id="compile" maxOccurs="1">
-		<annotation>
-		            Compile the generated file</annotation>
+		<annotation>Compile the generated file</annotation>
 		<switch>compile</switch>
 	    </option>
 	    
 	    <option id="classdir" maxOccurs="1">
-		<annotation>
-		            Specify where to place generated class files</annotation>
+		<annotation>Specify where to place generated class files</annotation>
 		<switch>classdir</switch>
 		<associatedArgument placement="afterSpace">
 		    <annotation>compile-classes-directory</annotation>
 		</associatedArgument>
 	    </option>
 	    
+	    <!--
 	    <option id="impl" maxOccurs="1">
 		<annotation>
-		            Generate the dummy service implementation.</annotation>
+		Generate the dummy service implementation.</annotation>
 		<switch>impl</switch>
 	    </option>
 
 	    <option id="server" maxOccurs="1">
 		<annotation>
-		            Generates the server code</annotation>
+		Generates the server code</annotation>
 		<switch>server</switch>
 	    </option>
 
 	    <option id="client" maxOccurs="1">
 		<annotation>
-		            Generates the client code.</annotation>
+		Generates the client code.</annotation>
 		<switch>client</switch>
 	    </option>
 
 	    <option id="all" maxOccurs="1">
 		<annotation>
-		            Generates interfaces,types,service,server,impl,client
-		            and ant script.
+		    Generates interfaces,types,service,server,impl,client
+		    and ant script.
 		</annotation>
 		<switch>all</switch>
 	    </option>
-	    		
+	    
 	    <option id="ant" maxOccurs="1">
 		<annotation>
-		            ant script generation.
+		    ant script generation.
 		</annotation>
 		<switch>ant</switch>
 	    </option>
+	    -->
 
-        <option id="nexclude" maxOccurs="unbounded">
-                <annotation>
-                            The wsdl namespace to exclude for generating code. This 
-		            option can be specified multiple times. Also, Optionally 
-                            specify the java package name to use for this wsdl namespace.
-                 </annotation>
-            <switch>nexclude</switch>
-            <associatedArgument placement="afterSpace">
-                <annotation>schema namespace [= java packagename]</annotation>
-            </associatedArgument>
-        </option>
-
-        <option id="exsoapheader" maxOccurs="1">
-            <annotation>
-                            To enable processing of extended soap header message binding
-            </annotation>
-            <switch>exsh</switch>
-            <associatedArgument placement="afterSpace">
-                <annotation>enable extended soap header message binding (true, false)</annotation>
-                <valueenum>true|false</valueenum>
-            </associatedArgument>
-        </option>
-
-        <option id="defaultns" maxOccurs="1">
-                 <annotation>
-                            To enable loading the default namespace package name mapping
-                 </annotation>
-            <switch>dns</switch>
-            <associatedArgument placement="afterSpace">
-                <annotation>Default value is true</annotation>
-                <valueenum>true|false</valueenum>
-            </associatedArgument>
-        </option>
-
-        <option id="defaultex" maxOccurs="1">
-                 <annotation>
-                            To enable loading the default excludes namespace mapping</annotation>
-            <switch>dex</switch>
-            <associatedArgument placement="afterSpace">
-                <annotation>Default value is true</annotation>
-                <valueenum>true|false</valueenum>
-            </associatedArgument>
-        </option>
-
-        <option id="validate" maxOccurs="1">
-                <annotation>
-                            To valiate the wsdl before generate the code. We highly sugguest 
-                            you to run the tool called schema validator before generating 
-                            the code.
-            </annotation>
-            <switch>validate</switch>
-        </option>
+	    <option id="nexclude" maxOccurs="unbounded">
+		<annotation>
+		    The wsdl namespace to exclude for generating code. This 
+		    option can be specified multiple times. Also, Optionally 
+		    specify the java package name to use for this wsdl namespace.
+		</annotation>
+		<switch>nexclude</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>schema namespace [= java packagename]</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="exsoapheader" maxOccurs="1">
+		<annotation>To enable processing of extended soap header message binding
+		</annotation>
+		<switch>exsh</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>enable extended soap header message binding (true, false)</annotation>
+		    <valueenum>true|false</valueenum>
+		</associatedArgument>
+	    </option>
+
+	    <option id="defaultns" maxOccurs="1">
+		<annotation>To enable loading the default namespace package name mapping
+		</annotation>
+		<switch>dns</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>Default value is true</annotation>
+		    <valueenum>true|false</valueenum>
+		</associatedArgument>
+	    </option>
+
+	    <option id="defaultex" maxOccurs="1">
+		<annotation>To enable loading the default excludes namespace mapping</annotation>
+		<switch>dex</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>Default value is true</annotation>
+		    <valueenum>true|false</valueenum>
+		</associatedArgument>
+	    </option>
+
+	    <option id="validate" maxOccurs="1">
+		<annotation>
+		    To valiate the wsdl before generate the code. We highly sugguest 
+		    you to run the tool called schema validator before generating 
+		    the code.
+		</annotation>
+		<switch>validate</switch>
+	    </option>
 
 	</optionGroup>
 	<optionGroup id="common_options">
 	    <option id="help" maxOccurs="1">
-		<annotation>
-		            Display detailed information for options.</annotation>
+		<annotation>Display detailed information for options.</annotation>
 		<switch>h</switch>
 		<switch>?</switch>
 		<switch>help</switch>
 	    </option>
 	    
 	    <option id="version">
-		<annotation>
-		            Display the version of the tool.</annotation>
+		<annotation>Display the version of the tool.</annotation>
 		<switch>v</switch>
 	    </option>
 
 	    <option id="verbose">
-		<annotation>
-		            Verbose mode</annotation>
+		<annotation>Verbose mode</annotation>
 		<switch>verbose</switch>
 		<switch>V</switch>
 	    </option>
 
 	    <option id="quiet">
-		<annotation>
-		            Quiet mode</annotation>
+		<annotation>Quiet mode</annotation>
 		<switch>quiet</switch>
 		<switch>q</switch>
 	    </option>
 
 	</optionGroup>
 	<argument id="wsdlurl" minOccurs="1" maxOccurs="1">
-	        <annotation>
-	                    WSDL URL</annotation>
+	    <annotation>WSDL URL</annotation>
 	</argument>
     </usage>
 </toolspec>

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd Thu Dec 14 19:40:13 2006
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+	   xmlns="http://cxf.apache.org/tools/plugin" 
+	   targetNamespace="http://cxf.apache.org/tools/plugin" 
+	   elementFormDefault="qualified">
+
+    <xs:complexType name="DataBinding">
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string" use="required"/>
+	<xs:attribute name="profile" type="xs:string" use="required"/>
+    </xs:complexType>
+    
+    <xs:complexType name="FrontEnd">
+	<xs:sequence>
+	    <xs:element name="generators" type="Generators"/>
+	    <xs:element name="processor" type="Processor" maxOccurs="1" minOccurs="1"/>
+	    <xs:element name="container" type="Container" maxOccurs="1" minOccurs="1"/>
+	    <xs:element name="builder" type="Builder" maxOccurs="1"/>
+	</xs:sequence>
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string" use="required"/>
+	<xs:attribute name="profile" type="xs:string" use="required"/>
+    </xs:complexType>
+    
+    <xs:element name="generator" type="Generator"/>
+    <xs:complexType name="Generator">
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string"/>
+    </xs:complexType>
+    <xs:complexType name="Processor">
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string"/>
+    </xs:complexType>
+    <xs:complexType name="Builder">
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string"/>
+    </xs:complexType>
+    <xs:complexType name="Container">
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="package" type="xs:string"/>
+	<xs:attribute name="toolspec" type="xs:string" use="required"/>
+    </xs:complexType>
+
+    <xs:complexType name="Generators">
+	<xs:sequence>
+	    <xs:element ref="generator" maxOccurs="unbounded"/>
+	</xs:sequence>
+	<xs:attribute name="package" type="xs:string"/>
+    </xs:complexType>
+
+    <xs:element name="plugin" type="Plugin"/>
+    <xs:complexType name="Plugin">
+	<xs:sequence>
+	    <xs:element name="frontend" type="FrontEnd" maxOccurs="unbounded"/>
+	    <xs:element name="databinding" type="DataBinding" maxOccurs="unbounded"/>
+	</xs:sequence>
+	<xs:attribute name="name" type="xs:string" use="required"/>
+	<xs:attribute name="version" type="xs:string" use="required"/>
+	<xs:attribute name="provider" type="xs:string" use="required"/>
+    </xs:complexType>
+
+</xs:schema>

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/main/resources/schemas/plugin.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto;
+
+import java.io.*;
+import java.util.*;
+
+import junit.framework.TestCase;
+
+public class WSDLToJavaTest extends TestCase {
+
+    
+    public void testGetFrontEndName() throws Exception {
+        WSDLToJava w2j = new WSDLToJava();
+        assertEquals("jaxws", w2j.getFrontEndName(new String[]{"-frontend", "jaxws"}));
+        assertEquals("jaxws", w2j.getFrontEndName(new String[]{"-fe", "jaxws"}));
+        assertNull(w2j.getFrontEndName(new String[]{"-frontend"}));
+        assertNull(w2j.getFrontEndName(new String[]{"-fe"}));
+        assertNull(w2j.getFrontEndName(new String[]{"nothing"}));
+        assertNull(w2j.getFrontEndName(null));
+    }
+
+    public void testGetDataBindingName() throws Exception {
+        WSDLToJava w2j = new WSDLToJava();
+        assertEquals("jaxb", w2j.getDataBindingName(new String[]{"-databinding", "jaxb"}));
+        assertEquals("jaxb", w2j.getDataBindingName(new String[]{"-db", "jaxb"}));
+        assertNull(w2j.getDataBindingName(new String[]{"-databinding"}));
+        assertNull(w2j.getDataBindingName(new String[]{"-db"}));
+        assertNull(w2j.getDataBindingName(new String[]{"nothing"}));
+        assertNull(w2j.getDataBindingName(null));
+        assertNull(w2j.getDataBindingName(new String[]{"-frontend", "jaxws"}));
+    }
+
+    public void testIsVerbose() {
+        WSDLToJava w2j = new WSDLToJava();
+        w2j.setArguments(new String[]{"-V"});
+        assertTrue(w2j.isVerbose());
+        w2j = new WSDLToJava();
+        w2j.setArguments(new String[]{"-verbose"});
+        assertTrue(w2j.isVerbose());
+        w2j = new WSDLToJava();
+        w2j.setArguments(new String[]{"none"});
+        assertFalse(w2j.isVerbose());
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLToJavaTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.tools.common.ToolConstants;
+
+public class WSDLVersionTest extends TestCase {
+    
+    public void testWSDLVersion() {
+        assertEquals(ToolConstants.WSDLVersion.WSDL11, WSDLVersion.getVersion("1.1"));
+        assertEquals(ToolConstants.WSDLVersion.WSDL20, WSDLVersion.getVersion("2.0"));
+        assertEquals(ToolConstants.WSDLVersion.UNKNOWN, WSDLVersion.getVersion("3.0"));
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/WSDLVersionTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,115 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.core;
+
+import java.io.*;
+import java.util.*;
+
+import junit.framework.TestCase;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.plugin.DataBinding;
+import org.apache.cxf.tools.plugin.FrontEnd;
+import org.apache.cxf.tools.plugin.Generator;
+import org.apache.cxf.tools.plugin.Plugin;
+
+public class PluginLoaderTest extends TestCase {
+
+    public void testLoadPlugins() throws Exception {
+        PluginLoader loader = PluginLoader.getInstance();
+        assertEquals(1, loader.getPlugins().size());
+        assertEquals("default", getPlugin(loader, 0).getName());
+
+        try {
+            loader.getFrontEndProfile("jaxws");
+            fail("There is no jaxws frontend by defult");
+        } catch (ToolException e) {            
+            assertEquals(getLogMessage("FRONTEND_MISSING", "jaxws"), e.getMessage());
+        }
+        
+        loader.loadPlugin("/org/apache/cxf/tools/wsdlto/core/plugin.xml");
+        assertEquals(2, loader.getPlugins().size());
+        Plugin plugin = getPlugin(loader, 1);
+        assertEquals("test", plugin.getName());
+        assertEquals("2.0", plugin.getVersion());
+        assertEquals("apache cxf", plugin.getProvider());
+        
+        Map<String, FrontEnd> frontends = loader.getFrontEnds();
+        assertNotNull(frontends);
+        assertEquals(1, frontends.size());
+
+        FrontEnd frontend = getFrontEnd(frontends, 0);
+        assertEquals("jaxws", frontend.getName());
+        assertEquals("org.apache.cxf.tools.wsdlto.frontend.jaxws", frontend.getPackage());
+        assertEquals("JAXWSProfile", frontend.getProfile());
+        assertNotNull(frontend.getGenerators());
+        assertNotNull(frontend.getGenerators().getGenerator());
+        assertEquals(2, frontend.getGenerators().getGenerator().size());
+        assertEquals("AntGenerator", getGenerator(frontend, 0).getName());
+        assertEquals("ImplGenerator", getGenerator(frontend, 1).getName());
+
+        assertEquals("org.apache.cxf.tools.wsdlto.core", frontend.getContainer().getPackage());
+        assertEquals("DummyContainer", frontend.getContainer().getName());
+        assertEquals("dummy.toolspec", frontend.getContainer().getToolspec());
+
+        try {
+            loader.getFrontEndProfile("jaxws");
+            fail("JaxWs frontend not loaded yet");
+        } catch (ToolException e) {
+            System.err.println(e.getMessage());
+            assertEquals(getLogMessage("FRONTEND_PROFILE_LOAD_FAIL", frontend.getPackage()
+                                       + "."
+                                       + frontend.getProfile()),
+                         e.getMessage());
+        }
+        
+        Map<String, DataBinding> databindings = loader.getDataBindings();
+        assertNotNull(databindings);
+        assertEquals(1, databindings.size());
+        
+        DataBinding databinding = getDataBinding(databindings, 0);
+        assertEquals("jaxb", databinding.getName());
+        assertEquals("org.apache.cxf.tools.wsdlto.databinding.jaxb", databinding.getPackage());
+        assertEquals("JAXBBindingGenerator", databinding.getProfile());
+    }
+
+    protected String getLogMessage(String key, Object...params) {
+        return new Message(key, PluginLoader.LOG, params).toString();
+    }
+
+    protected Generator getGenerator(FrontEnd frontend, int index) {
+        return frontend.getGenerators().getGenerator().get(index);
+    }
+    
+    protected FrontEnd getFrontEnd(Map<String, FrontEnd> frontends, int index) {
+        int size = frontends.size();
+        return frontends.values().toArray(new FrontEnd[size])[index];
+    }
+
+    protected DataBinding getDataBinding(Map<String, DataBinding> databindings, int index) {
+        int size = databindings.size();
+        return databindings.values().toArray(new DataBinding[size])[index];
+    }
+    
+    protected Plugin getPlugin(PluginLoader loader, int index) {
+        int size = loader.getPlugins().size();
+        return loader.getPlugins().values().toArray(new Plugin[size])[index];
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/PluginLoaderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<plugin name="test" version="2.0" provider="apache cxf" xmlns="http://cxf.apache.org/tools/plugin">
+    <frontend name="jaxws" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
+	<container name="DummyContainer" toolspec="dummy.toolspec" package="org.apache.cxf.tools.wsdlto.core"/>
+	<generators>
+	    <generator name="AntGenerator"/>
+	    <generator name="ImplGenerator"/>
+	</generators>
+    </frontend>	
+    <databinding name="jaxb" package="org.apache.cxf.tools.wsdlto.databinding.jaxb" profile="JAXBBindingGenerator"/>
+</plugin>
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/core/src/test/java/org/apache/cxf/tools/wsdlto/core/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-tools2-wsdlto-databinding-jaxb</artifactId>
+    <packaging>jar</packaging>
+    <version>2.0-incubator-RC-SNAPSHOT</version>
+    <name>Apache CXF Command Line Tools2 WSDLTo JAXB Databinding</name>
+    <url>http://cwiki.apache.org/confluence/display/CXF/Index</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-tools2-wsdlto</artifactId>
+        <version>2.0-incubator-RC-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <topDirectoryLocation>../../../</topDirectoryLocation>
+    </properties>
+
+</project>

Propchange: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,69 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-tools2-wsdlto-frontend-jaxws</artifactId>
+    <packaging>jar</packaging>
+    <version>2.0-incubator-RC-SNAPSHOT</version>
+    <name>Apache CXF Command Line Tools2 WSDLTo JAXWS Frontend</name>
+    <url>http://cwiki.apache.org/confluence/display/CXF/Index</url>
+
+    <parent>
+	<groupId>org.apache.cxf</groupId>
+	<artifactId>cxf-tools2-wsdlto</artifactId>
+	<version>2.0-incubator-RC-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+	<topDirectoryLocation>../../../</topDirectoryLocation>
+    </properties>
+    <dependencies>
+	<dependency>
+	    <groupId>junit</groupId>
+	    <artifactId>junit</artifactId>
+	    <scope>test</scope>
+	</dependency>
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-tools-common</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-tools-wsdl2java</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-rt-core</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+
+	<dependency>
+	    <groupId>org.apache.cxf</groupId>
+	    <artifactId>cxf-tools2-wsdlto-core</artifactId>
+	    <version>${project.version}</version>
+	</dependency>
+
+    </dependencies>
+</project>

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import java.io.File;
+import java.util.Set;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
+import org.apache.cxf.tools.wsdlto.WSDLToJavaContainer;
+
+public class JAXWSContainer extends WSDLToJavaContainer {
+    
+    private static final String TOOL_NAME = "wsdl2java";
+    
+    public JAXWSContainer(ToolSpec toolspec) throws Exception {
+        super(TOOL_NAME, toolspec);
+    }
+
+    protected Set<String> getArrayKeys() {
+        Set<String> set = super.getArrayKeys();
+        set.add(ToolConstants.CFG_BINDING);
+        return set;
+    }
+
+    public void validate(ToolContext env) throws ToolException {
+        super.validate(env);
+        
+        if (env.containsKey(ToolConstants.CFG_BINDING)) {
+            String[] bindings = (String[])env.get(ToolConstants.CFG_BINDING);
+            for (int i = 0; i < bindings.length; i++) {
+                File binding = new File(bindings[i]);
+                if (!binding.exists()) {
+                    Message msg = new Message("FILE_NOT_EXIST", LOG, binding);
+                    throw new ToolException(msg);
+                } else if (binding.isDirectory()) {
+                    Message msg = new Message("NOT_A_FILE", LOG, binding);
+                    throw new ToolException(msg);
+                }
+            }
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSContainer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+//import org.apache.cxf.tools.wsdlto.core.FrontEndGenerator;
+
+public class JAXWSProfile extends FrontEndProfile {
+    // empty
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfile.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<toolspec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	  xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict"
+	  xsi:schemaLocation="http://www.xsume.com/Xutil/ToolSpecification http://www.xsume.com/schema/xutil/tool-specification.xsd"
+	  xmlns="http://www.xsume.com/Xutil/ToolSpecification"
+	  xmlns:ts="http://www.xsume.com/Xutil/ToolSpecification">
+
+    <annotation>
+Examples :
+
+wsdl2java HelloWorld.wsdl
+wsdl2java -p com.iona.greeting Greeting.wsdl
+wsdl2java -client HelloWorld.wsdl
+    </annotation>
+
+    <usage>
+	<optionGroup id="options">
+	    <option id="frontend" maxOccurs="unbounded">
+		<annotation>
+		    Specify the frontend (default to JAXWS)
+		</annotation>
+		<switch>fe</switch>
+		<switch>frontend</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>frontend name</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="databinding" maxOccurs="unbounded">
+		<annotation>
+		    Specify the data binding (default to JAXB)
+		</annotation>
+		<switch>db</switch>
+		<switch>databinding</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>data binding name</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="wsdlversion" maxOccurs="unbounded">
+		<annotation>
+		    WSDL version, default is WSDL1.1
+		</annotation>
+		<switch>wv</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>[wsdl version]</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="packagename" maxOccurs="unbounded">
+		<annotation>
+		            The java package name to use for the generated code.
+		            Also, optionally specify the wsdl namespace mapping 
+		            to a particular java packagename.
+		</annotation>
+		<switch>p</switch>
+		<associatedArgument placement="afterSpace">
+			<valuetype>NamingSpacePackageString</valuetype>
+		<annotation>[wsdl namespace =]Package Name</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="binding" maxOccurs="unbounded">
+		<annotation>
+		            Specify external jaxws or jaxb binding files, (Each 
+		            file must have its own -b)
+		</annotation>
+		<switch>b</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>binding-name</annotation>
+		</associatedArgument>
+	    </option>
+
+	    <option id="outputdir" maxOccurs="1">
+		<annotation>
+		            The directory in which the code is placed</annotation>
+		<switch>d</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>output-directory</annotation>
+		</associatedArgument>
+	    </option>
+	    
+	    <option id="compile" maxOccurs="1">
+		<annotation>
+		            Compile the generated file</annotation>
+		<switch>compile</switch>
+	    </option>
+	    
+	    <option id="classdir" maxOccurs="1">
+		<annotation>
+		            Specify where to place generated class files</annotation>
+		<switch>classdir</switch>
+		<associatedArgument placement="afterSpace">
+		    <annotation>compile-classes-directory</annotation>
+		</associatedArgument>
+	    </option>
+	    
+	    <option id="impl" maxOccurs="1">
+		<annotation>
+		            Generate the dummy service implementation.</annotation>
+		<switch>impl</switch>
+	    </option>
+
+	    <option id="server" maxOccurs="1">
+		<annotation>
+		            Generates the server code</annotation>
+		<switch>server</switch>
+	    </option>
+
+	    <option id="client" maxOccurs="1">
+		<annotation>
+		            Generates the client code.</annotation>
+		<switch>client</switch>
+	    </option>
+
+	    <option id="all" maxOccurs="1">
+		<annotation>
+		            Generates interfaces,types,service,server,impl,client
+		            and ant script.
+		</annotation>
+		<switch>all</switch>
+	    </option>
+	    		
+	    <option id="ant" maxOccurs="1">
+		<annotation>
+		            ant script generation.
+		</annotation>
+		<switch>ant</switch>
+	    </option>
+
+        <option id="nexclude" maxOccurs="unbounded">
+                <annotation>
+                            The wsdl namespace to exclude for generating code. This 
+		            option can be specified multiple times. Also, Optionally 
+                            specify the java package name to use for this wsdl namespace.
+                 </annotation>
+            <switch>nexclude</switch>
+            <associatedArgument placement="afterSpace">
+                <annotation>schema namespace [= java packagename]</annotation>
+            </associatedArgument>
+        </option>
+
+        <option id="exsoapheader" maxOccurs="1">
+            <annotation>
+                            To enable processing of extended soap header message binding
+            </annotation>
+            <switch>exsh</switch>
+            <associatedArgument placement="afterSpace">
+                <annotation>enable extended soap header message binding (true, false)</annotation>
+                <valueenum>true|false</valueenum>
+            </associatedArgument>
+        </option>
+
+        <option id="defaultns" maxOccurs="1">
+                 <annotation>
+                            To enable loading the default namespace package name mapping
+                 </annotation>
+            <switch>dns</switch>
+            <associatedArgument placement="afterSpace">
+                <annotation>Default value is true</annotation>
+                <valueenum>true|false</valueenum>
+            </associatedArgument>
+        </option>
+
+        <option id="defaultex" maxOccurs="1">
+                 <annotation>
+                            To enable loading the default excludes namespace mapping</annotation>
+            <switch>dex</switch>
+            <associatedArgument placement="afterSpace">
+                <annotation>Default value is true</annotation>
+                <valueenum>true|false</valueenum>
+            </associatedArgument>
+        </option>
+
+        <option id="validate" maxOccurs="1">
+                <annotation>
+                            To valiate the wsdl before generate the code. We highly sugguest 
+                            you to run the tool called schema validator before generating 
+                            the code.
+            </annotation>
+            <switch>validate</switch>
+        </option>
+
+	</optionGroup>
+	<optionGroup id="common_options">
+	    <option id="help" maxOccurs="1">
+		<annotation>
+		            Display detailed information for options.</annotation>
+		<switch>h</switch>
+		<switch>?</switch>
+		<switch>help</switch>
+	    </option>
+	    
+	    <option id="version">
+		<annotation>
+		            Display the version of the tool.</annotation>
+		<switch>v</switch>
+	    </option>
+
+	    <option id="verbose">
+		<annotation>
+		            Verbose mode</annotation>
+		<switch>verbose</switch>
+		<switch>V</switch>
+	    </option>
+
+	    <option id="quiet">
+		<annotation>
+		            Quiet mode</annotation>
+		<switch>quiet</switch>
+		<switch>q</switch>
+	    </option>
+
+	</optionGroup>
+	<argument id="wsdlurl" minOccurs="1" maxOccurs="1">
+	        <annotation>
+	                    WSDL URL</annotation>
+	</argument>
+    </usage>
+</toolspec>

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11;
+
+import javax.wsdl.Definition;
+
+import org.apache.cxf.tools.common.extensions.jaxws.CustomizationParser;
+import org.apache.cxf.tools.wsdlto.core.AbstractWSDLBuilder;
+import org.apache.cxf.wsdl.WSDLBuilder;
+import org.apache.cxf.wsdl11.WSDLDefinitionBuilder;
+
+public class JAXWSDefinitionBuilder extends AbstractWSDLBuilder<Definition> {
+
+    public Definition build(String wsdlURL) {
+        WSDLBuilder<Definition> builder = new WSDLDefinitionBuilder();
+        return builder.build(wsdlURL);
+    }
+    
+    public void customize(Definition t) {
+        CustomizationParser customizationParser = CustomizationParser.getInstance();
+        customizationParser.clean();
+        customizationParser.parse(context, t);
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import java.util.List;
+
+import javax.wsdl.Part;
+import javax.xml.namespace.QName;
+
+import com.sun.tools.xjc.api.Property;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+
+public class DummyDataBinding implements org.apache.cxf.tools.wsdlto.core.DataBindingProfile {
+    public void initialize(ToolContext context) throws ToolException {
+    }
+
+    public void generate() throws ToolException {
+    }
+
+    
+    public String getType(QName qn, boolean fullName) {
+        return null;
+    }
+    
+    public String getJavaType(QName qn, boolean boxify) {
+        return null;
+    }
+    
+    public List<? extends Property> getBlock(Part part) {
+        return null;
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/DummyDataBinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws;
+
+import java.io.*;
+import java.util.*;
+
+//import org.apache.cxf.tools.wsdlto.core.FrontEndGenerator;
+import junit.framework.TestCase;
+
+import org.apache.cxf.tools.common.FrontEndGenerator;
+import org.apache.cxf.tools.common.Processor;
+
+
+import org.apache.cxf.tools.plugin.FrontEnd;
+import org.apache.cxf.tools.plugin.Generator;
+import org.apache.cxf.tools.plugin.Plugin;
+import org.apache.cxf.tools.wsdl2java.frontend.jaxws.AntGenerator;
+import org.apache.cxf.tools.wsdl2java.frontend.jaxws.ImplGenerator;
+import org.apache.cxf.tools.wsdl2java.processor.WSDLToJavaProcessor;
+import org.apache.cxf.tools.wsdlto.core.AbstractWSDLBuilder;
+import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
+import org.apache.cxf.tools.wsdlto.core.PluginLoader;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder;
+
+public class JAXWSProfileTest extends TestCase {
+    public void testLoadPlugins() {
+        PluginLoader loader = PluginLoader.getInstance();
+        assertNotNull(loader);
+
+        loader.loadPlugin("/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml");
+        
+        assertEquals(2, loader.getPlugins().size());
+        Plugin plugin = getPlugin(loader, 1);
+        assertEquals("tools-jaxws-frontend", plugin.getName());
+        assertEquals("2.0", plugin.getVersion());
+        assertEquals("apache cxf", plugin.getProvider());
+
+        Map<String, FrontEnd> frontends = loader.getFrontEnds();
+        assertNotNull(frontends);
+        assertEquals(1, frontends.size());
+
+        FrontEnd frontend = getFrontEnd(frontends, 0);
+        assertEquals("jaxws", frontend.getName());
+        assertEquals("org.apache.cxf.tools.wsdlto.frontend.jaxws", frontend.getPackage());
+        assertEquals("JAXWSProfile", frontend.getProfile());
+        assertNotNull(frontend.getGenerators());
+        assertNotNull(frontend.getGenerators().getGenerator());
+        assertEquals(2, frontend.getGenerators().getGenerator().size());
+        assertEquals("AntGenerator", getGenerator(frontend, 0).getName());
+        assertEquals("ImplGenerator", getGenerator(frontend, 1).getName());
+
+        FrontEndProfile profile = loader.getFrontEndProfile("jaxws");
+        assertNotNull(profile);
+        
+        List<FrontEndGenerator> generators = profile.getGenerators();
+        assertNotNull(generators);
+        assertEquals(2, generators.size());
+        assertTrue(generators.get(0) instanceof AntGenerator);
+        assertTrue(generators.get(1) instanceof ImplGenerator);
+
+        Processor processor = profile.getProcessor();
+        assertNotNull(processor);
+        assertTrue(processor instanceof WSDLToJavaProcessor);
+
+        AbstractWSDLBuilder builder = profile.getWSDLBuilder();
+        assertNotNull(builder);
+        assertTrue(builder instanceof JAXWSDefinitionBuilder);
+
+        Class container = profile.getContainerClass();
+        assertEquals(container, JAXWSContainer.class);
+        System.err.println(profile.getToolspec());
+        assertEquals("/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-toolspec.xml", profile.getToolspec());
+    }
+
+    protected Generator getGenerator(FrontEnd frontend, int index) {
+        return frontend.getGenerators().getGenerator().get(index);
+    }
+    
+    protected FrontEnd getFrontEnd(Map<String, FrontEnd> frontends, int index) {
+        int size = frontends.size();
+        return frontends.values().toArray(new FrontEnd[size])[index];
+    }
+
+    protected Plugin getPlugin(PluginLoader loader, int index) {
+        int size = loader.getPlugins().size();
+        return loader.getPlugins().values().toArray(new Plugin[size])[index];
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/JAXWSProfileTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml Thu Dec 14 19:40:13 2006
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<plugin name="tools-jaxws-frontend" version="2.0" provider="apache cxf" xmlns="http://cxf.apache.org/tools/plugin">
+    <frontend name="jaxws" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="JAXWSProfile">
+	<container name="JAXWSContainer" toolspec="jaxws-toolspec.xml"/>
+	<processor name="WSDLToJavaProcessor" package="org.apache.cxf.tools.wsdl2java.processor"/>
+	<builder name="JAXWSDefinitionBuilder" package="org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11"/>
+	<generators package="org.apache.cxf.tools.wsdl2java.frontend.jaxws">
+	    <generator name="AntGenerator"/>
+	    <generator name="ImplGenerator"/>
+	</generators>
+    </frontend>
+    <databinding name="jaxb" package="org.apache.cxf.tools.wsdlto.frontend.jaxws" profile="DummyDataBinding"/>
+</plugin>
\ No newline at end of file

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/jaxws-plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java?view=auto&rev=487441
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java Thu Dec 14 19:40:13 2006
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11;
+
+import junit.framework.TestCase;
+
+public class JAXWSDefinitionBuilderTest extends TestCase {
+
+    public void testCustomization() {
+        // TODO: to port from tools
+    } 
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message