cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r440665 [1/2] - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/ common/src/main/java/org/apache/cxf/tools/util/ common/src/test/java/org/apa...
Date Wed, 06 Sep 2006 09:22:40 GMT
Author: ema
Date: Wed Sep  6 02:22:36 2006
New Revision: 440665

URL: http://svn.apache.org/viewvc?view=rev&rev=440665
Log:
Renamed GneratorPlugin and PluginProfile class, moved jaxb and jaxws generator under frontend directory

Added:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGenerator.java
      - copied, changed from r440634, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/GeneratorPlugin.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java
      - copied, changed from r440634, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/PluginProfile.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
      - copied, changed from r440644, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorEnvironment.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/TypesCodeWriter.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AntGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ClientGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/FaultGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/HandlerConfigGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ImplGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/JAXWSProfile.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/Messages.properties   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/SEIGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServerGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/ServiceGenerator.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java   (with props)
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/build.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/client.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/fault.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/impl.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/sei.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/server.vm
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/template/service.vm
Removed:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/GeneratorPlugin.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/PluginProfile.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorEnvironment.java
Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Processor.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/CustomizationParser.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
    incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorEnvironmentTest.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java
    incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java
    incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
    incubator/cxf/trunk/tools/misctools/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/AbstractValidator.java
    incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/AbstractProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/JAXBBindingMerger.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/MIMEProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/PortTypeProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/SEIAnnotationProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java Wed Sep  6 02:22:36 2006
@@ -25,7 +25,7 @@
 
 import com.sun.tools.xjc.api.Property;
 public interface DataBindingGenerator { 
-    void initialize(ProcessorEnvironment penv);
+    void initialize(ToolContext penv);
     void generate() throws ToolException;
     String getType(QName qn, boolean fullName);
     String getJavaType(QName qn, boolean fullName);

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGenerator.java (from r440634, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/GeneratorPlugin.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGenerator.java?view=diff&rev=440665&p1=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/GeneratorPlugin.java&r1=440634&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGenerator.java&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/GeneratorPlugin.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGenerator.java Wed Sep  6 02:22:36 2006
@@ -24,8 +24,8 @@
  *
  * @author codea
  */
-public interface GeneratorPlugin {
+public interface FrontEndGenerator {
 
-    void generate(ProcessorEnvironment penv);
+    void generate(ToolContext penv);
 }
 

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java (from r440634, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/PluginProfile.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java?view=diff&rev=440665&p1=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/PluginProfile.java&r1=440634&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/PluginProfile.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java Wed Sep  6 02:22:36 2006
@@ -21,6 +21,6 @@
 
 import java.util.List;
 
-public interface PluginProfile {
-    List<GeneratorPlugin> getPlugins();
+public interface FrontEndGeneratorsProfile {
+    List<FrontEndGenerator> getPlugins();
 }

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Processor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Processor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Processor.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Processor.java Wed Sep  6 02:22:36 2006
@@ -22,5 +22,5 @@
 
 public interface Processor {
     void process() throws ToolException;
-    void setEnvironment(ProcessorEnvironment env);
+    void setEnvironment(ToolContext env);
 }

Copied: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java (from r440644, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorEnvironment.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java?view=diff&rev=440665&p1=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorEnvironment.java&r1=440644&p2=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorEnvironment.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java Wed Sep  6 02:22:36 2006
@@ -30,7 +30,7 @@
 import org.apache.cxf.tools.util.PropertyUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
-public class ProcessorEnvironment {
+public class ToolContext {
 
     protected JavaModel javaModel;
     private Map<String, Object> paramMap;
@@ -41,7 +41,7 @@
     private List<String> excludePkgList = new java.util.ArrayList<String>();
     private List<String> excludeFileList = new java.util.ArrayList<String>();
    
-    public ProcessorEnvironment() {
+    public ToolContext() {
     }
 
 

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/CustomizationParser.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/CustomizationParser.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/CustomizationParser.java Wed Sep  6 02:22:36 2006
@@ -19,9 +19,16 @@
 
 package org.apache.cxf.tools.common.extensions.jaxws;
 
-import java.io.*;
-import java.net.*;
-import java.util.*;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.logging.Logger;
 
 import javax.wsdl.Binding;
@@ -40,6 +47,7 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -48,8 +56,8 @@
 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.ProcessorEnvironment;
 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.util.ProcessorUtil;
 import org.apache.cxf.tools.util.StAXUtil;
@@ -57,7 +65,7 @@
 public final class CustomizationParser {
     private static final Logger LOG = LogUtils.getL7dLogger(CustomizationParser.class);
     private static CustomizationParser parser;
-    private ProcessorEnvironment env;
+    private ToolContext env;
     private final Set<Element> jaxwsBindings = new HashSet<Element>();
     private Definition definition;
     private final Map<BindingsNode, JAXWSBinding>definitionExtensions;
@@ -135,7 +143,7 @@
         return xpathExpression.matches(regex);
     }
     
-    public void parse(ProcessorEnvironment pe, Definition def) {
+    public void parse(ToolContext pe, Definition def) {
         this.env = pe;
         this.definition = def;
         String[] bindingFiles;

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java Wed Sep  6 02:22:36 2006
@@ -41,8 +41,8 @@
 import com.sun.xml.bind.api.JAXBRIContext;
 
 import org.apache.cxf.tools.common.DataBindingGenerator;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 public final class ProcessorUtil {
@@ -70,7 +70,7 @@
         return mangleNameToClassName(getPartType(part));
     }
     
-    public static String getType(Part part, ProcessorEnvironment env, boolean fullname) {
+    public static String getType(Part part, ToolContext env, boolean fullname) {
         DataBindingGenerator dataBinder = (DataBindingGenerator)env.get(ToolConstants.BINDING_GENERATOR);
         String type = dataBinder.getType(getElementName(part), fullname);
         if (type == null) {
@@ -94,7 +94,7 @@
     // support multiple -p options
     // if user change the package name through -p namespace=package name
     //
-    public static QName getMappedElementName(Part part, ProcessorEnvironment env) {
+    public static QName getMappedElementName(Part part, ToolContext env) {
         QName origin = getElementName(part);
         if (origin == null) {
             return null;
@@ -105,7 +105,7 @@
         return new QName(env.getCustomizedNS(origin.getNamespaceURI()), origin.getLocalPart());
     }
 
-    public static String resolvePartType(Part part, ProcessorEnvironment env) {
+    public static String resolvePartType(Part part, ToolContext env) {
         if (env != null) {
             return resolvePartType(part, env, false);
         } else {
@@ -117,7 +117,7 @@
         return resolvePartType(part, env, false);
     }*/
 
-    public static String resolvePartType(Part part, ProcessorEnvironment env, boolean fullName) {
+    public static String resolvePartType(Part part, ToolContext env, boolean fullName) {
         DataBindingGenerator binder = (DataBindingGenerator)env.get(ToolConstants.BINDING_GENERATOR);
         if (binder == null) {
             return resolvePartType(part);
@@ -221,7 +221,7 @@
     //
     // the non-wrapper style will get the type info from the part directly
     //
-    public static String getFullClzName(Part part, ProcessorEnvironment env,
+    public static String getFullClzName(Part part, ToolContext env,
                                         ClassCollector collector, boolean boxify) {
         DataBindingGenerator dataBindingGenerator = (DataBindingGenerator)env
             .get(ToolConstants.BINDING_GENERATOR);
@@ -301,7 +301,7 @@
    
 
     @SuppressWarnings("unchecked")
-    public static boolean isWrapperStyle(Operation operation, ProcessorEnvironment env) throws ToolException {
+    public static boolean isWrapperStyle(Operation operation, ToolContext env) throws ToolException {
 
         Message inputMessage = operation.getInput() == null ? null : operation.getInput().getMessage();
         Message outputMessage = operation.getOutput() == null ? null : operation.getOutput().getMessage();

Modified: incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorEnvironmentTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorEnvironmentTest.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorEnvironmentTest.java (original)
+++ incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorEnvironmentTest.java Wed Sep  6 02:22:36 2006
@@ -27,7 +27,7 @@
     public void testGet() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "v1");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
         String value = (String)env.get("k1");
         assertEquals("v1", value);
@@ -36,7 +36,7 @@
     public void testPut() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "v1");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
         env.put("k2", "v2");
         String value = (String)env.get("k2");
@@ -46,7 +46,7 @@
     public void testRemove() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "v1");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
         env.put("k2", "v2");
         String value = (String)env.get("k2");
@@ -58,7 +58,7 @@
     public void testContainsKey() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "v1");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
         assertTrue(env.containsKey("k1"));
     }
@@ -66,7 +66,7 @@
     public void testGetDefaultValue() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "v1");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
 
         String k1 = (String)env.get("k1", "v2");
@@ -78,7 +78,7 @@
     public void testOptionSet() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "true");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
 
         assertTrue(env.optionSet("k1"));
@@ -88,7 +88,7 @@
     public void testGetBooleanValue() {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("k1", "true");
-        ProcessorEnvironment env = new ProcessorEnvironment();
+        ToolContext env = new ToolContext();
         env.setParameters(map);
 
         Boolean k1 = Boolean.valueOf((String)env.get("k1"));

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java Wed Sep  6 02:22:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -50,7 +50,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(new HashSet()));
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/TypesGenerator.java Wed Sep  6 02:22:36 2006
@@ -40,7 +40,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.tools.common.model.WSDLModel;
@@ -50,9 +50,9 @@
     private WSDLModel wmodel;
     private Definition definition;
     private ExtensionRegistry extensionRegistry;
-    private ProcessorEnvironment env;
+    private ToolContext env;
     
-    public TypesGenerator(WSDLModel model , ProcessorEnvironment penv) {
+    public TypesGenerator(WSDLModel model , ToolContext penv) {
         this.definition = model.getDefinition();
         this.wmodel = model;
         env = penv;

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGenerator.java Wed Sep  6 02:22:36 2006
@@ -23,15 +23,15 @@
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLWriter;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.model.WSDLModel;
 
 public class WSDLGenerator {
     private final WSDLModel wmodel;
 
-    private final ProcessorEnvironment env;
+    private final ToolContext env;
 
     private final Definition definition;
 
@@ -41,7 +41,7 @@
 
     private String portTypeName;
 
-    public WSDLGenerator(WSDLModel model, ProcessorEnvironment penv) {
+    public WSDLGenerator(WSDLModel model, ToolContext penv) {
         wmodel = model;
         env = penv;
         definition = model.getDefinition();

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLOutputResolver.java Wed Sep  6 02:22:36 2006
@@ -30,18 +30,18 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.model.WSDLModel;
 import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
 
 public class WSDLOutputResolver extends SchemaOutputResolver {
     private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class);
-    private final ProcessorEnvironment env;
+    private final ToolContext env;
     private final WSDLModel wmodel;
 
-    public WSDLOutputResolver(ProcessorEnvironment penv, WSDLModel model) {
+    public WSDLOutputResolver(ToolContext penv, WSDLModel model) {
         this.env = penv;
         this.wmodel = model;
     }

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java Wed Sep  6 02:22:36 2006
@@ -25,13 +25,11 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
-
 import org.apache.cxf.tools.common.Processor;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.model.WSDLModel;
-
 import org.apache.cxf.tools.java2wsdl.generator.WSDLGenerator;
 import org.apache.cxf.tools.java2wsdl.processor.internal.ClassProcessor;
 import org.apache.cxf.tools.util.AnnotationUtil;
@@ -40,7 +38,7 @@
 public class JavaToWSDLProcessor implements Processor {
     private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class);
     private WSDLModel model;
-    private ProcessorEnvironment penv;
+    private ToolContext penv;
     private Class seiClass;
 
     public void process() throws ToolException {
@@ -63,11 +61,11 @@
         classproc.process(wmodel);
     }
 
-    public void setEnvironment(ProcessorEnvironment env) {
+    public void setEnvironment(ToolContext env) {
         this.penv = env;
     }
 
-    public ProcessorEnvironment getEnvironment() {
+    public ToolContext getEnvironment() {
         return this.penv;
     }
 

Modified: incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/ClassProcessor.java Wed Sep  6 02:22:36 2006
@@ -34,16 +34,13 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.WSDLConstants;
-
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.WSDLModel;
-
 import org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor;
-
 import org.apache.cxf.tools.util.AnnotationUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
@@ -56,9 +53,9 @@
 
     Map<Class, Boolean> useWebMethodClasses = new HashMap<Class, Boolean>();
 
-    private final ProcessorEnvironment env;
+    private final ToolContext env;
 
-    public ClassProcessor(Class clz, ProcessorEnvironment penv) {
+    public ClassProcessor(Class clz, ToolContext penv) {
         seiClass = clz;
         env = penv;
     }

Modified: incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java (original)
+++ incubator/cxf/trunk/tools/java2wsdl/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ProcessorTestBase.java Wed Sep  6 02:22:36 2006
@@ -26,13 +26,13 @@
 
 import junit.framework.TestCase;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 public class ProcessorTestBase extends TestCase {
 
     private static final int RETRY_SLEEP_MILLIS = 10;
-    protected ProcessorEnvironment env = new ProcessorEnvironment();
+    protected ToolContext env = new ToolContext();
     protected File output;
 
     public void setUp() throws Exception {

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java Wed Sep  6 02:22:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -53,7 +53,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
 
                 if (isVerboseOn()) {
@@ -85,7 +85,7 @@
         }
     }
 
-    private void validate(ProcessorEnvironment env) throws ToolException {
+    private void validate(ToolContext env) throws ToolException {
         String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
         if (outdir != null) {
             File dir = new File(outdir);

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java Wed Sep  6 02:22:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -57,7 +57,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
@@ -88,7 +88,7 @@
         }
     }
 
-    private void setEnvParamDefValues(ProcessorEnvironment env) {
+    private void setEnvParamDefValues(ToolContext env) {
         if (!env.optionSet(ToolConstants.CFG_BINDING)) {
             env.put(ToolConstants.CFG_BINDING, env.get(ToolConstants.CFG_PORTTYPE) + BINDING_NAME_POSFIX);
         }
@@ -100,7 +100,7 @@
         }        
     }
 
-    private void validate(ProcessorEnvironment env) throws ToolException {
+    private void validate(ToolContext env) throws ToolException {
         String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
         if (outdir != null) {
             File dir = new File(outdir);

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java Wed Sep  6 02:22:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -57,7 +57,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
@@ -88,7 +88,7 @@
         }
     }
 
-    private void setEnvParamDefValues(ProcessorEnvironment env) {
+    private void setEnvParamDefValues(ToolContext env) {
         if (!env.optionSet(ToolConstants.CFG_BINDING)) {
             env.put(ToolConstants.CFG_BINDING, env.get(ToolConstants.CFG_PORTTYPE) + BINDING_NAME_POSFIX);
         }
@@ -100,7 +100,7 @@
         }        
     }
 
-    private void validate(ProcessorEnvironment env) throws ToolException {
+    private void validate(ToolContext env) throws ToolException {
         String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
         if (outdir != null) {
             File dir = new File(outdir);

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java Wed Sep  6 02:22:36 2006
@@ -25,8 +25,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -55,7 +55,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
@@ -84,7 +84,7 @@
     }
 
 
-    private void validate(ProcessorEnvironment env) throws ToolException {
+    private void validate(ToolContext env) throws ToolException {
         String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
         if (outdir != null) {
             File dir = new File(outdir);

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java Wed Sep  6 02:22:36 2006
@@ -40,14 +40,12 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.tools.common.Processor;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.util.ClassCollector;
 import org.apache.cxf.tools.util.FileWriterUtil;
 import org.apache.cxf.tools.util.WSDLExtensionRegister;
-
 import org.apache.cxf.tools.validator.internal.WSDL11Validator;
 
 public class AbstractWSDLToProcessor implements Processor, com.sun.tools.xjc.api.ErrorListener {
@@ -55,7 +53,7 @@
     protected static final String WSDL_FILE_NAME_EXT = ".wsdl";
 
     protected Definition wsdlDefinition;
-    protected ProcessorEnvironment env;
+    protected ToolContext env;
     protected WSDLFactory wsdlFactory;
     protected WSDLReader wsdlReader;
 
@@ -212,11 +210,11 @@
 
 
 
-    public void setEnvironment(ProcessorEnvironment penv) {
+    public void setEnvironment(ToolContext penv) {
         this.env = penv;
     }
 
-    public ProcessorEnvironment getEnvironment() {
+    public ToolContext getEnvironment() {
         return this.env;
     }
 

Modified: incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/main/java/org/apache/cxf/tools/misc/processor/XSDToWSDLProcessor.java Wed Sep  6 02:22:36 2006
@@ -41,8 +41,8 @@
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.tools.common.Processor;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.WSDLConstants;
 import org.apache.cxf.tools.common.dom.ExtendedDocumentBuilder;
@@ -63,7 +63,7 @@
     private String xsdUrl;
     private final ExtendedDocumentBuilder xsdBuilder = new ExtendedDocumentBuilder();
     private Document xsdDoc;
-    private ProcessorEnvironment env;
+    private ToolContext env;
 
     public void process() throws ToolException {
         envParamSetting();
@@ -72,7 +72,7 @@
         addWSDLTypes();
     }
 
-    public void setEnvironment(ProcessorEnvironment newEnv) {
+    public void setEnvironment(ToolContext newEnv) {
         this.env = newEnv;
     }
 

Modified: incubator/cxf/trunk/tools/misctools/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/misctools/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/misctools/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java (original)
+++ incubator/cxf/trunk/tools/misctools/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java Wed Sep  6 02:22:36 2006
@@ -32,7 +32,7 @@
 public class ProcessorTestBase extends TestCase {
 
     private static final int RETRY_SLEEP_MILLIS = 10;
-    protected ProcessorEnvironment env = new ProcessorEnvironment();
+    protected ToolContext env = new ToolContext();
     protected File output;
 
     public void setUp() throws Exception {

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java (original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java Wed Sep  6 02:22:36 2006
@@ -24,8 +24,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
@@ -53,7 +53,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/AbstractValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/AbstractValidator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/AbstractValidator.java (original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/AbstractValidator.java Wed Sep  6 02:22:36 2006
@@ -25,13 +25,13 @@
 import javax.wsdl.Definition;
 import javax.xml.stream.Location;
 
-import org.apache.cxf.tools.common.ProcessorEnvironment;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 public abstract class AbstractValidator {
     protected List<String> errorMessages = new Vector<String>();
     protected Definition def;
-    protected ProcessorEnvironment env;
+    protected ToolContext env;
 
     public AbstractValidator(Definition definition) {
         this.def = definition;
@@ -40,7 +40,7 @@
     public AbstractValidator(String schemaDir) throws ToolException {
     }
 
-    public AbstractValidator(Definition definition, ProcessorEnvironment pEnv) {
+    public AbstractValidator(Definition definition, ToolContext pEnv) {
         this.def = definition;
         this.env = pEnv;
     }

Modified: incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java (original)
+++ incubator/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java Wed Sep  6 02:22:36 2006
@@ -19,12 +19,14 @@
 
 package org.apache.cxf.tools.validator.internal;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.wsdl.Definition;
 
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
 import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 
 
@@ -37,7 +39,7 @@
         super(definition);
     }
 
-    public WSDL11Validator(Definition definition, ProcessorEnvironment pe) {
+    public WSDL11Validator(Definition definition, ToolContext pe) {
         super(definition, pe);
     }
 

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java?view=diff&rev=440665&r1=440664&r2=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/WSDLToJava.java Wed Sep  6 02:22:36 2006
@@ -27,18 +27,15 @@
 import java.util.Set;
 
 import org.apache.cxf.common.i18n.Message;
-
 import org.apache.cxf.tools.common.AbstractCXFToolContainer;
-import org.apache.cxf.tools.common.ProcessorEnvironment;
-
 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.ToolRunner;
 import org.apache.cxf.tools.common.toolspec.ToolSpec;
 import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
 import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
 import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
-
 import org.apache.cxf.tools.wsdl2java.processor.WSDLToJavaProcessor;
 
 public class WSDLToJava extends AbstractCXFToolContainer {
@@ -64,7 +61,7 @@
         try {
             super.execute(exitOnFinish);
             if (!hasInfoOption()) {
-                ProcessorEnvironment env = new ProcessorEnvironment();
+                ToolContext env = new ToolContext();
                 env.setParameters(getParametersMap(getArrayKeys()));
                 if (env.get(ToolConstants.CFG_OUTPUTDIR) == null) {
                     env.put(ToolConstants.CFG_OUTPUTDIR, ".");
@@ -105,7 +102,7 @@
         }
     }
 
-    private void loadDefaultNSPackageMapping(ProcessorEnvironment env) {
+    private void loadDefaultNSPackageMapping(ToolContext env) {
         if (!env.hasExcludeNamespace(DEFAULT_NS2PACKAGE) 
             && env.getBooleanValue(ToolConstants.CFG_DEFAULT_NS, "true")) {
             env.loadDefaultNS2Pck(getResourceAsStream("namespace2package.cfg"));
@@ -116,7 +113,7 @@
     }
 
 
-    private void setExcludePackageAndNamespaces(ProcessorEnvironment env) {
+    private void setExcludePackageAndNamespaces(ToolContext env) {
         if (env.get(ToolConstants.CFG_NEXCLUDE) != null) {
             String[] pns = (String[])env.get(ToolConstants.CFG_NEXCLUDE);
             for (int j = 0; j < pns.length; j++) {
@@ -133,7 +130,7 @@
         }
     }
     
-    private void setPackageAndNamespaces(ProcessorEnvironment env) {
+    private void setPackageAndNamespaces(ToolContext env) {
         if (env.get(ToolConstants.CFG_PACKAGENAME) != null) {
             String[] pns = (String[])env.get(ToolConstants.CFG_PACKAGENAME);
             for (int j = 0; j < pns.length; j++) {
@@ -150,7 +147,7 @@
         }
     }
 
-    private void validate(ProcessorEnvironment env) throws ToolException {
+    private void validate(ToolContext env) throws ToolException {
         String outdir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
         if (outdir != null) {
             File dir = new File(outdir);
@@ -194,7 +191,7 @@
         }
     }
 
-    protected void setAntProperties(ProcessorEnvironment env) {
+    protected void setAntProperties(ToolContext env) {
         String installDir = System.getProperty("install.dir");
         if (installDir != null) {
             env.put(ToolConstants.CFG_INSTALL_DIR, installDir);
@@ -203,7 +200,7 @@
         }
     }
 
-    protected void setLibraryReferences(ProcessorEnvironment env) {
+    protected void setLibraryReferences(ToolContext env) {
         Properties props = loadProperties(getResourceAsStream("wsdltojavalib.properties"));
         if (props != null) {
             for (Iterator keys = props.keySet().iterator(); keys.hasNext();) {

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,60 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+
+import com.sun.tools.xjc.api.ErrorListener;
+
+import org.apache.cxf.tools.common.ToolContext;
+
+public class JAXBBindErrorListener implements ErrorListener {
+    private ToolContext env;
+
+    public JAXBBindErrorListener(ToolContext penv) {
+        env = penv;
+    }
+
+    public void error(org.xml.sax.SAXParseException exception) {
+        if (this.env.isVerbose()) {
+            exception.printStackTrace();
+        } else {
+            System.err.println("Parsing schema error: \n" + exception.toString());
+        }
+    }
+
+    public void fatalError(org.xml.sax.SAXParseException exception) {
+        if (this.env.isVerbose()) {
+            exception.printStackTrace();
+        } else {
+            System.err.println("Parsing schema fatal error: \n" + exception.toString());
+        }
+    }
+
+    public void info(org.xml.sax.SAXParseException exception) {
+        if (this.env.isVerbose()) {
+            System.err.println("Parsing schema info: " + exception.toString());
+        }
+    }
+
+    public void warning(org.xml.sax.SAXParseException exception) {
+        if (this.env.isVerbose()) {
+            System.err.println("Parsing schema warning " + exception.toString());
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindErrorListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,368 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+
+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;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Part;
+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;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.xml.sax.InputSource;
+
+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;
+
+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.DataBindingGenerator;
+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.util.ClassCollector;
+import org.apache.cxf.tools.util.JAXBUtils;
+import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.util.URIParserUtil;
+import org.apache.cxf.tools.wsdl2java.processor.internal.ClassNameAllocatorImpl;
+public class JAXBBindingGenerator implements DataBindingGenerator {
+    private static final Logger LOG = LogUtils.getL7dLogger(JAXBBindingGenerator.class);
+    protected S2JJAXBModel rawJaxbModel;
+    protected S2JJAXBModel rawJaxbModelGenCode;
+    private boolean nestedJaxbBinding;
+    private Model model;
+    private ToolContext env;
+    private int fileIDX;
+
+    @SuppressWarnings("unchecked")
+    public void initialize(ToolContext penv) {
+        env = penv;
+
+        SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();
+        ClassCollector classCollector = (ClassCollector)env.get(ToolConstants.GENERATED_CLASS_COLLECTOR);
+
+        ClassNameAllocatorImpl allocator = new ClassNameAllocatorImpl(classCollector);
+
+        Map<QName, PortType> portTypeMap = (Map<QName, PortType>)env.get(ToolConstants.PORTTYPE_MAP);
+        Definition def = (Definition)env.get(ToolConstants.WSDL_DEFINITION);
+
+        allocator.setPortTypes(portTypeMap.values(), env.mapPackageName(def.getTargetNamespace()));
+
+        schemaCompiler.setClassNameAllocator(allocator);
+        JAXBBindErrorListener listener = new JAXBBindErrorListener(env);
+        schemaCompiler.setErrorListener(listener);
+
+        SchemaCompilerImpl schemaCompilerGenCode = schemaCompiler;
+        String excludePackageName = "";
+        if (env.isExcludeNamespaceEnabled()) {
+            schemaCompilerGenCode = (SchemaCompilerImpl)XJC.createSchemaCompiler();
+            schemaCompilerGenCode.setClassNameAllocator(allocator);
+            schemaCompilerGenCode.setErrorListener(listener);
+        }
+        List schemaSystemidList = new ArrayList();
+
+        Options opt = new OptionsEx();
+        List<Schema> schemaList = env.getSchemaList();
+        for (Schema schema : schemaList) {
+
+            Element schemaElement = schema.getElement();
+            String targetNamespace = schemaElement.getAttribute("targetNamespace");
+            if (StringUtils.isEmpty(targetNamespace)) {
+                continue;
+            }
+
+            if (env.hasExcludeNamespace(targetNamespace)) {
+                excludePackageName = env.getExcludePackageName(targetNamespace);
+                if (excludePackageName != null) {
+                    env.getExcludePkgList().add(excludePackageName);
+                } else {
+                    env.getExcludePkgList().add(URIParserUtil.getPackageName(targetNamespace));
+                }
+            }
+            customizeSchema(schemaElement, targetNamespace);
+            String systemid = schema.getDocumentBaseURI();
+            if (schemaSystemidList.contains(systemid)) {
+                systemid = schema.getDocumentBaseURI() + "#" + targetNamespace;
+            }
+            schemaSystemidList.add(systemid);
+            schemaCompiler.parseSchema(systemid, schemaElement);
+            schemaCompilerGenCode.parseSchema(systemid, schemaElement);
+            if (nestedJaxbBinding) {
+                processNestedBinding(schemaElement, systemid, opt);
+
+            }
+
+        }
+
+        Collection<InputSource> jaxbBindingFiles = env.getJaxbBindingFile().values();
+        for (InputSource bindingFile : jaxbBindingFiles) {
+            schemaCompiler.parseSchema(bindingFile);
+            if (env.isExcludeNamespaceEnabled()) {
+                schemaCompilerGenCode.parseSchema(bindingFile);
+            }
+        }
+        rawJaxbModel = schemaCompiler.bind();
+        if (env.isExcludeNamespaceEnabled()) {
+            rawJaxbModelGenCode = schemaCompilerGenCode.bind();
+        } else {
+            rawJaxbModelGenCode = rawJaxbModel;
+        }
+        if (nestedJaxbBinding) {
+            opt.classNameAllocator = allocator;
+            model = ModelLoader.load(opt, new JCodeModel(), new JAXBErrorReceiver(env));
+            model.generateCode(opt, new JAXBErrorReceiver(env));
+        }
+
+    }
+
+    private void processNestedBinding(Element schemaElement, String systemid, Options opt) {
+        String xsdFile = "schema" + (fileIDX++);
+        File file = null;
+        try {
+            file = File.createTempFile(xsdFile, ".xsd");
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        Result result = new StreamResult(file);
+        DOMSource source = new DOMSource(schemaElement);
+
+        try {
+            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 = null;
+        try {
+            insource = new InputSource((InputStream)new FileInputStream(file));
+        } catch (FileNotFoundException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        insource.setSystemId(systemid);
+        opt.setSchemaLanguage(Language.XMLSCHEMA);
+        opt.addGrammar(file);
+    }
+
+    public void generate() throws ToolException {
+        if (env.optionSet(ToolConstants.CFG_GEN_CLIENT) || env.optionSet(ToolConstants.CFG_GEN_SERVER)) {
+            return;
+        }
+        if (rawJaxbModelGenCode == null) {
+            return;
+        }
+        try {
+            String dir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
+
+            TypesCodeWriter fileCodeWriter = new TypesCodeWriter(new File(dir), env.getExcludePkgList());
+
+            if (rawJaxbModelGenCode instanceof S2JJAXBModel && !nestedJaxbBinding) {
+                S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;
+
+                JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);
+                jcodeModel.build(fileCodeWriter);
+                for (String str : fileCodeWriter.getExcludeFileList()) {
+                    env.getExcludeFileList().add(str);
+                }
+            }
+
+            if (rawJaxbModelGenCode instanceof S2JJAXBModel && nestedJaxbBinding) {
+                model.codeModel.build(fileCodeWriter);
+                for (String str : fileCodeWriter.getExcludeFileList()) {
+                    env.getExcludeFileList().add(str);
+                }
+            }
+
+            return;
+        } catch (IOException e) {
+            Message msg = new Message("FAIL_TO_GENERATE_TYPES", LOG); 
+            throw new ToolException(msg);
+        }
+    }
+
+    public String getType(QName qn, boolean fullName) {
+        String type;
+        if (rawJaxbModel == null) {
+            return null;
+        }
+        com.sun.tools.xjc.api.Mapping mapping = rawJaxbModel.get(qn);
+        if (mapping == null) {
+            return null;
+        }
+        if (fullName) {
+            type = mapping.getType().getTypeClass().fullName();
+            if (type == null) {
+                type = mapping.getType().getTypeClass().boxify().fullName();
+            }
+            return type;
+
+        } else {
+            type = mapping.getType().getTypeClass().name();
+            if (type == null) {
+                type = mapping.getType().getTypeClass().boxify().name();
+            }
+            return type;
+        }
+
+    }
+
+    public String getJavaType(QName qn, boolean boxify) {
+        String jtypeClass;
+        if (rawJaxbModel == null) {
+            return null;
+        }
+        TypeAndAnnotation jtype = rawJaxbModel.getJavaType(qn);
+        if (jtype == null || jtype.getTypeClass() == null) {
+            return null;
+        } else {         
+            if (boxify) {           
+                jtypeClass = jtype.getTypeClass().boxify().fullName();
+            } else {
+                jtypeClass = jtype.getTypeClass().name();
+            }
+        }
+        
+        return jtypeClass;
+    
+
+    }
+
+    private void customizeSchema(Element schema, String targetNamespace) {
+        String userPackage = env.mapPackageName(targetNamespace);
+        if (env.hasExcludeNamespace(targetNamespace) && env.getExcludePackageName(targetNamespace) != null) {
+            // generate excluded namespace types classes with specified package
+            // name
+            userPackage = env.getExcludePackageName(targetNamespace);
+        }
+        if (!isSchemaParsed(targetNamespace) && !StringUtils.isEmpty(userPackage)) {
+            Node jaxbBindings = JAXBUtils.innerJaxbPackageBinding(schema, userPackage);
+            schema.appendChild(jaxbBindings);
+        }
+
+        int nodeListLen = schema.getElementsByTagNameNS(ToolConstants.SCHEMA_URI, "import").getLength();
+        for (int i = 0; i < nodeListLen; i++) {
+            removeImportElement(schema);
+        }
+        JAXBBindingMerger jaxbBindingMerger = new JAXBBindingMerger();
+        jaxbBindingMerger.mergeJaxwsBinding(schema, env);
+
+        if (jaxbBindingMerger.isMerged()) {
+            nestedJaxbBinding = true;
+        }
+    }
+
+    private void removeImportElement(Element element) {
+        NodeList nodeList = element.getElementsByTagNameNS(ToolConstants.SCHEMA_URI, "import");
+        if (nodeList.getLength() > 0) {
+            Node importNode = nodeList.item(0);
+            Node schemaNode = importNode.getParentNode();
+            schemaNode.removeChild(importNode);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private boolean isSchemaParsed(String targetNamespace) {
+        List schemaNamespaces = (List)env.get(ToolConstants.SCHEMA_TARGET_NAMESPACES);
+        if (!schemaNamespaces.contains(targetNamespace)) {
+            schemaNamespaces.add(targetNamespace);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    public List<? extends Property> getBlock(Part part) {
+        if (part == null) {
+            return new ArrayList<Property>();
+        }
+
+        // QName element = getMappedElementName(part, env);
+        QName element = ProcessorUtil.getElementName(part);
+
+        if (element != null && rawJaxbModel != null) {
+            com.sun.tools.xjc.api.Mapping mapping = rawJaxbModel.get(element);
+            if (mapping != null) {
+                return mapping.getWrapperStyleDrilldown();
+            } else {
+                org.apache.cxf.common.i18n.Message msg = 
+                    new org.apache.cxf.common.i18n.Message("ELEMENT_MISSING",
+                                                           LOG,
+                                                           new Object[] {element.toString(), 
+                                                                         part.getName()});
+                System.err.println(msg);
+                // return new ArrayList<Property>();
+            }
+        }
+        return new ArrayList<Property>();
+    }
+
+    private class OptionsEx extends Options {
+
+        protected Mode mode = Mode.CODE;
+
+        protected int parseArgument(String[] args, int i) throws BadCommandLineException {
+
+            return super.parseArgument(args, i);
+        }
+    }
+
+    private enum Mode {
+        CODE, BGM, SIGNATURE, FOREST, DRYRUN, ZIP,
+    }
+
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,159 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+
+import java.io.File;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.common.logging.LogUtils;
+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.util.ProcessorUtil;
+
+
+public class JAXBBindingMerger {   
+    protected static final Logger LOG = LogUtils.getL7dLogger(JAXBBindingMerger.class);
+    private boolean merged;
+    public void mergeJaxwsBinding(Element schema, ToolContext env) {
+        String[] bindingFiles;
+        try {
+            bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);
+        } catch (ClassCastException e) {
+            bindingFiles = new String[1];
+            bindingFiles[0] = (String)env.get(ToolConstants.CFG_BINDING);
+        }
+       
+        if (bindingFiles == null) {
+            return;
+        }
+        
+        for (int i = 0; i < bindingFiles.length; i++) {
+            File jaxwsFile = new File(bindingFiles[i]);
+            // get jaxBidnings nested in jaxws bindings
+            NodeList jaxbBindingList = getJaxbBindingsNodes(jaxwsFile);
+            String elementpath = ".";
+            if (jaxbBindingList != null && jaxbBindingList.getLength() > 0) {
+                for (int j = 0; j < jaxbBindingList.getLength(); j++) {
+                    Node bindingNode = jaxbBindingList.item(j);
+                    elementpath = ((Element)bindingNode).getAttribute("node");
+
+                    NamespaceContext nsContext = (NamespaceContext)new NamespaceContextImpl(jaxwsFile);
+                    NodeList bindNodesInSchemaElement = findBindingNode(schema, elementpath, nsContext);
+
+                    if (bindNodesInSchemaElement != null && bindNodesInSchemaElement.getLength() > 0) {
+                        for (int k = 0; k < bindNodesInSchemaElement.getLength(); k++) {
+                            // set jaxb namespace and jaxb version attribute
+                            String jaxbPrefix = schema.lookupPrefix("http://java.sun.com/xml/ns/jaxb");
+                            if (jaxbPrefix == null) {
+                                schema.setAttribute("xmlns:jaxb", "http://java.sun.com/xml/ns/jaxb");
+                                schema.setAttribute("jaxb:version", "2.0");
+                            }
+                            // bindElement in schema
+                            Element bindElement = (Element)bindNodesInSchemaElement.item(k);
+                            NodeList jaxbBindings = bindingNode.getChildNodes();
+                            if (jaxbBindings.getLength() != 0) {
+                                Element annoElement = 
+                                    bindElement.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI, 
+                                                                                   "annotation");
+                                Element appinfoEle = 
+                                    bindElement.getOwnerDocument().createElementNS(ToolConstants.SCHEMA_URI, 
+                                                                                   "appinfo");
+                                annoElement.appendChild(appinfoEle);
+                                for (int l = 0; l < jaxbBindings.getLength(); l++) {
+                                    Node jaxbBindingNode = jaxbBindings.item(l);
+                                    Node node = ProcessorUtil.cloneNode(bindElement.getOwnerDocument(), 
+                                                                jaxbBindingNode, true);
+                                    appinfoEle.appendChild(node);
+                                }
+                                if (bindElement.getChildNodes().getLength() > 0) {
+                                    bindElement
+                                        .insertBefore(annoElement, bindElement.getChildNodes().item(0));
+                                } else {
+                                    bindElement.appendChild(annoElement);
+                                }
+                                merged = true;
+                            }
+                           
+                        }
+                    }
+                }
+            }
+
+        }
+        
+        
+    }
+
+    private NodeList findBindingNode(Element schemaElement, String bindingPath, NamespaceContext nsContext) {
+        XPathFactory xpathFactory = XPathFactory.newInstance();
+        javax.xml.xpath.XPath xpath = xpathFactory.newXPath();
+        xpath.setNamespaceContext(nsContext);
+        NodeList nodelist = null;
+        try {
+            nodelist = (NodeList)xpath.evaluate(bindingPath, schemaElement,
+                                                javax.xml.xpath.XPathConstants.NODESET);
+        } catch (XPathExpressionException e) {
+            e.printStackTrace();
+        }
+        return nodelist;
+    }
+
+    private NodeList getJaxbBindingsNodes(File jaxwsFile) {
+        DocumentBuilderFactory docBuilderFact = DocumentBuilderFactory.newInstance();
+        docBuilderFact.setNamespaceAware(true);
+        Document jaxwsDoc;
+        NodeList nodeList = null;
+
+        try {
+            jaxwsDoc = docBuilderFact.newDocumentBuilder().parse(jaxwsFile);
+            NodeList jaxwsBindingNodeList = jaxwsDoc.getElementsByTagNameNS(ToolConstants.NS_JAXWS_BINDINGS,
+                                                                            "bindings");
+
+            if (jaxwsBindingNodeList.getLength() == 0) {
+                return null;
+            }
+            nodeList = jaxwsDoc.getElementsByTagNameNS(ToolConstants.NS_JAXB_BINDINGS, "bindings");
+        } catch (Exception e) {
+            org.apache.cxf.common.i18n.Message msg = 
+                new org.apache.cxf.common.i18n.Message("FAIL_TO_GET_JAXBINDINGNODE_FROM_JAXWSBINDING",
+                                                             LOG);
+            LOG.log(Level.SEVERE, msg.toString());
+            throw new ToolException(msg, e);
+        } 
+        return nodeList;
+    }
+    
+    public boolean isMerged() {
+        return merged;
+    }
+    
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBBindingMerger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,66 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+
+import com.sun.tools.xjc.ErrorReceiver;
+
+import org.apache.cxf.tools.common.ToolContext;
+
+public class JAXBErrorReceiver extends ErrorReceiver {
+    private ToolContext env;
+
+    public JAXBErrorReceiver(ToolContext penv) {
+        env = penv;
+    }
+
+    public void warning(org.xml.sax.SAXParseException saxEx) throws com.sun.tools.xjc.AbortException {
+        if (env.isVerbose()) {
+            saxEx.printStackTrace();
+        } else {
+            System.err.println("Use jaxb customization binding file to generate types warring "
+                               + saxEx.getMessage());
+        }
+
+    }
+
+    public void error(org.xml.sax.SAXParseException saxEx) throws com.sun.tools.xjc.AbortException {
+        if (env.isVerbose()) {
+            saxEx.printStackTrace();
+        } else {
+            System.err.println("Use jaxb customization binding file to generate types error "
+                               + saxEx.getMessage());
+        }
+    }
+
+    public void info(org.xml.sax.SAXParseException saxEx) {
+        if (env.isVerbose()) {
+            saxEx.printStackTrace();
+        }
+    }
+
+    public void fatalError(org.xml.sax.SAXParseException saxEx) throws com.sun.tools.xjc.AbortException {
+        if (env.isVerbose()) {
+            saxEx.printStackTrace();
+        } else {
+            System.err.println("Use jaxb customization binding file to generate types fatal error "
+                               + saxEx.getMessage());
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/JAXBErrorReceiver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties Wed Sep  6 02:22:36 2006
@@ -0,0 +1,4 @@
+FAIL_TO_GENERATE_TYPES = Fail to generate types
+
+
+

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java?view=auto&rev=440665
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java Wed Sep  6 02:22:36 2006
@@ -0,0 +1,65 @@
+/**
+ * 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.wsdl2java.databindings.jaxb;
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.xml.sax.SAXException;
+
+public class NamespaceContextImpl implements NamespaceContext {
+    private Element element;
+
+    public NamespaceContextImpl(File file) {
+        Document document = null;
+        DocumentBuilderFactory docFact = DocumentBuilderFactory.newInstance();
+        docFact.setNamespaceAware(true);
+        try {
+            document = docFact.newDocumentBuilder().parse(file);
+        } catch (SAXException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (ParserConfigurationException e) {
+            e.printStackTrace();
+        }
+        element = document.getDocumentElement();
+    }
+
+    public String getNamespaceURI(String prefix) {
+        return element.lookupNamespaceURI(prefix);
+
+    }
+
+    public String getPrefix(String namespaceURI) {
+        return element.lookupPrefix(namespaceURI);
+    }
+
+    public Iterator getPrefixes(String namespaceURI) {
+        return null;
+    }
+
+}

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/databindings/jaxb/NamespaceContextImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message