cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r494811 - in /incubator/cxf/trunk/tools2: 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/common/extensions/jms/ common/src/main/...
Date Wed, 10 Jan 2007 13:37:34 GMT
Author: mmao
Date: Wed Jan 10 05:37:31 2007
New Revision: 494811

URL: http://svn.apache.org/viewvc?view=rev&rev=494811
Log:
Tools2 code clean up

* Clean up tools2/common 
  Ideally the common module should not depends on jaxb/wsdl4j etc.
  * Remove jaxws extensions from tools2/common/extensions, it is in tools2/frontend/jaxws sub module
  * Remove jms extension from tools2/common/extensions, the extension should be build in the wsdl builder
  * Remove the old interface DataBindingGenerator from tools2/common, they are defined in the tools2/core
  * Remove ProcessorUtil from tools2/common, the util depends on jaxb impl, the util has been moved to tools2/frontend/jaxws.
    and the mangle part moved to NameUtil, and uri methods moved to URIParserUtil
  * Remove WSDLExtensionRegister, the function should be covered in the wsdl builders.
* Clean up validtor
  * Revisit, remove the dependency on tools2/common/extensions/xmlformat, which should also be removed.
* Clean up generators
  * Copy the AbstractGenerator.java and VelocityWriter.java from tools to tools2/core, they can be reused by other frontends

  
  
  

Added:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java   (with props)
    incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java   (with props)
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java
      - copied, changed from r494755, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/VelocityWriter.java
      - copied, changed from r494755, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractJAXWSGenerator.java   (with props)
Removed:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/DataBindingGenerator.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/FrontEndGeneratorsProfile.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/extensions/jaxws/
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/extensions/jms/
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/WSDLExtensionRegister.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/JAXWSProfile.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/SEIAnnotationProcessor.java
Modified:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
    incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java Wed Jan 10 05:37:31 2007
@@ -28,7 +28,6 @@
 import org.xml.sax.InputSource;
 
 import org.apache.cxf.tools.common.model.JavaModel;
-import org.apache.cxf.tools.util.ProcessorUtil;
 import org.apache.cxf.tools.util.PropertyUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 
@@ -182,7 +181,7 @@
         if (hasNamespace(ns)) {
             return mapNamespaceToPackageName(ns);
         } else {
-            String pkg = ProcessorUtil.parsePackageName(ns, null);
+            String pkg = URIParserUtil.parsePackageName(ns, null);
             setPackageName(pkg);
             return pkg;
         }

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Wed Jan 10 05:37:31 2007
@@ -34,7 +34,7 @@
 import org.apache.cxf.tools.common.ToolException;
 
 public class JavaMethod implements JavaAnnotatable {
-    private static final Logger LOG = LogUtils.getL7dLogger(JavaMethod .class);
+    private static final Logger LOG = LogUtils.getL7dLogger(JavaMethod.class);
     private String name;
     private String operationName;
     private JavaReturn javaReturn;

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/AnnotationUtil.java Wed Jan 10 05:37:31 2007
@@ -68,13 +68,13 @@
     }
 
     public static synchronized URLClassLoader getClassLoader(ClassLoader parent) {
-        URL[] urls = ProcessorUtil.pathToURLs(getClassPath());
+        URL[] urls = URIParserUtil.pathToURLs(getClassPath());
         return new URLClassLoader(urls, parent);
     }
 
     public static synchronized Class loadClass(String className, ClassLoader parent) {
         Class clazz = null;
-        URL[] urls = ProcessorUtil.pathToURLs(getClassPath());
+        URL[] urls = URIParserUtil.pathToURLs(getClassPath());
         URLClassLoader classLoader = new URLClassLoader(urls, parent);
         try {
             clazz = classLoader.loadClass(className);

Added: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java?view=auto&rev=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java (added)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java Wed Jan 10 05:37:31 2007
@@ -0,0 +1,265 @@
+/**
+ * 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.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.helpers.JavaUtils;
+
+public final class NameUtil {
+
+    static final int UPPER_LETTER = 0;
+    static final int LOWER_LETTER = 1;
+    static final int OTHER_LETTER = 2;
+    static final int DIGIT = 3;
+    static final int OTHER = 4;
+
+    private static final byte ACTION_CHECK_PUNCT = 0;
+    private static final byte ACTION_CHECK_C2 = 1;
+    private static final byte ACTION_BREAK = 2;
+    private static final byte ACTION_NOBREAK = 3;
+
+    private static final byte[] ACTION_TABLE = new byte[5 * 5];
+
+    private NameUtil() {
+    }
+    
+    static {
+        for (int t0 = 0; t0 < 5; t0++) {
+            for (int t1 = 0; t1 < 5; t1++) {
+                ACTION_TABLE[t0 * 5 + t1] = decideAction(t0, t1);
+            }
+        }
+    }
+
+    protected static boolean isPunct(char c) {
+        boolean isPunct = c == '-' || c == '.' || c == ':' || c == '_';
+        boolean isUnicodePunct = c == '\u00b7' || c == '\u0387' || c == '\u06dd' || c == '\u06de';
+        return isPunct || isUnicodePunct;
+    }
+
+    protected static boolean isLower(char c) {
+        return c >= 'a' && c <= 'z' || Character.isLowerCase(c);
+    }
+
+    public static String capitalize(String s) {
+        if (!isLower(s.charAt(0))) {
+            return s;
+        }
+        StringBuilder sb = new StringBuilder(s.length());
+        sb.append(Character.toUpperCase(s.charAt(0)));
+        sb.append(s.substring(1).toLowerCase());
+        return sb.toString();
+    }
+
+    private static int nextBreak(String s, int start) {
+        int n = s.length();
+
+        char c1 = s.charAt(start);
+        int t1 = classify(c1);
+
+        for (int i = start + 1; i < n; i++) {
+            int t0 = t1;
+
+            c1 = s.charAt(i);
+            t1 = classify(c1);
+
+            switch (ACTION_TABLE[t0 * 5 + t1]) {
+            case ACTION_CHECK_PUNCT:
+                if (isPunct(c1)) {
+                    return i;
+                }
+                break;
+            case ACTION_CHECK_C2:
+                if (i < n - 1) {
+                    char c2 = s.charAt(i + 1);
+                    if (isLower(c2)) {
+                        return i;
+                    }
+                }
+                break;
+            case ACTION_BREAK:
+                return i;
+            default:
+            }
+        }
+        return -1;
+    }
+
+    private static byte decideAction(int t0, int t1) {
+        if (t0 == OTHER && t1 == OTHER)  {
+            return ACTION_CHECK_PUNCT;
+        }
+        if (!xor(t0 == DIGIT, t1 == DIGIT)
+            || (t0 == LOWER_LETTER && t1 != LOWER_LETTER)) {
+            return ACTION_BREAK;
+        }
+        if (!xor(t0 <= OTHER_LETTER, t1 <= OTHER_LETTER)) {
+            return ACTION_BREAK;
+        }
+        if (!xor(t0 == OTHER_LETTER, t1 == OTHER_LETTER)) {
+            return ACTION_BREAK;
+        }
+        if (t0 == UPPER_LETTER && t1 == UPPER_LETTER) {
+            return ACTION_CHECK_C2;
+        }
+
+        return ACTION_NOBREAK;
+    }
+
+    private static boolean xor(boolean x, boolean y) {
+        return (x && y) || (!x && !y);
+    }
+
+    protected static int classify(char c0) {
+        switch (Character.getType(c0)) {
+        case Character.UPPERCASE_LETTER:
+            return UPPER_LETTER;
+        case Character.LOWERCASE_LETTER:
+            return LOWER_LETTER;
+        case Character.TITLECASE_LETTER:
+        case Character.MODIFIER_LETTER:
+        case Character.OTHER_LETTER:
+            return OTHER_LETTER;
+        case Character.DECIMAL_DIGIT_NUMBER:
+            return DIGIT;
+        default:
+            return OTHER;
+        }
+    }
+
+
+    public static List<String> toWordList(String s) {
+        List<String> ss = new ArrayList<String>();
+        int n = s.length();
+        for (int i = 0; i < n;) {
+            while (i < n) {
+                if (!isPunct(s.charAt(i))) {
+                    break;
+                }
+                i++;
+            }
+            if (i >= n) {
+                break;
+            }
+
+            int b = nextBreak(s, i);
+            String w = (b == -1) ? s.substring(i) : s.substring(i, b);
+            ss.add(escape(capitalize(w)));
+            if (b == -1) {
+                break;
+            }
+            i = b;
+        }
+
+        return ss;
+    }
+
+    protected static String toMixedCaseName(List<String> ss, boolean startUpper) {
+        StringBuilder sb = new StringBuilder();
+        if (!ss.isEmpty()) {
+            sb.append(startUpper ? ss.get(0) : ss.get(0).toLowerCase());
+            for (int i = 1; i < ss.size(); i++) {
+                sb.append(ss.get(i));
+            }
+        }
+        return sb.toString();
+    }
+
+    protected static String toMixedCaseVariableName(String[] ss,
+                                             boolean startUpper,
+                                             boolean cdrUpper) {
+        if (cdrUpper) {
+            for (int i = 1; i < ss.length; i++) {
+                ss[i] = capitalize(ss[i]);
+            }
+        }
+        StringBuilder sb = new StringBuilder();
+        if (ss.length > 0) {
+            sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
+            for (int i = 1; i < ss.length; i++) {
+                sb.append(ss[i]);
+            }
+        }
+        return sb.toString();
+    }
+
+    public static void escape(StringBuilder sb, String s, int start) {
+        int n = s.length();
+        for (int i = start; i < n; i++) {
+            char c = s.charAt(i);
+            if (Character.isJavaIdentifierPart(c)) {
+                sb.append(c);
+            } else {
+                sb.append('_');
+                if (c <= '\u000f') {
+                    sb.append("000");
+                } else if (c <= '\u00ff') {
+                    sb.append("00");
+                } else if (c <= '\u0fff') {
+                    sb.append('0');
+                }
+                sb.append(Integer.toString(c, 16));
+            }
+        }
+    }
+
+    private static String escape(String s) {
+        int n = s.length();
+        for (int i = 0; i < n; i++) {
+            if (!Character.isJavaIdentifierPart(s.charAt(i))) {
+                StringBuilder sb = new StringBuilder(s.substring(0, i));
+                escape(sb, s, i);
+                return sb.toString();
+            }
+        }
+        return s;
+    }
+
+    public static boolean isJavaIdentifier(String s) {
+        if (s.length() == 0) {
+            return false;
+        }
+        if (JavaUtils.isJavaKeyword(s)) {
+            return false;
+        }
+
+        if (!Character.isJavaIdentifierStart(s.charAt(0))) {
+            return false;
+        }
+
+        for (int i = 1; i < s.length(); i++) {
+            if (!Character.isJavaIdentifierPart(s.charAt(i))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    public static String mangleNameToClassName(String name) {
+        return toMixedCaseName(toWordList(name), true);
+    }
+
+    public static String mangleNameToVariableName(String name) {
+        return toMixedCaseName(toWordList(name), false);
+    }    
+}

Propchange: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/NameUtil.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java (original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java Wed Jan 10 05:37:31 2007
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.tools.util;
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -38,6 +41,40 @@
 
     private URIParserUtil() {
         // complete
+    }
+
+    public static URL[] pathToURLs(String path) {
+        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
+        URL[] urls = new URL[st.countTokens()];
+        int count = 0;
+        while (st.hasMoreTokens()) {
+            File file = new File(st.nextToken());
+            URL url = null;
+            try {
+                url = file.toURL();
+            } catch (MalformedURLException e) {
+                e.printStackTrace();
+            }
+            if (url != null) {
+                urls[count++] = url;
+            }
+        }
+        if (urls.length != count) {
+            URL[] tmp = new URL[count];
+            System.arraycopy(urls, 0, tmp, 0, count);
+            urls = tmp;
+        }
+        return urls;
+    }
+
+    public static String parsePackageName(String namespace, String defaultPackageName) {
+        String packageName = (defaultPackageName != null && defaultPackageName.trim().length() > 0)
+            ? defaultPackageName : null;
+
+        if (packageName == null) {
+            packageName = getPackageName(namespace);
+        }
+        return packageName;
     }
 
     public static String getPackageName(String nameSpaceURI) {

Added: incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java?view=auto&rev=494811
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java (added)
+++ incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java Wed Jan 10 05:37:31 2007
@@ -0,0 +1,49 @@
+/**
+ * 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.util;
+
+import junit.framework.TestCase;
+
+public class NameUtilTest extends TestCase {
+    public void testMangleToClassName() {
+        assertEquals("Abc100Xyz",
+                     NameUtil.mangleNameToClassName("abc100xyz"));
+        assertEquals("NameUtilTest",
+                     NameUtil.mangleNameToClassName("name_util_test"));
+        assertEquals("NameUtil",
+                     NameUtil.mangleNameToClassName("nameUtil"));
+        assertEquals("Int", NameUtil.mangleNameToClassName("int"));
+    }
+
+    public void testMangleToVariableName() {
+        assertEquals("abc100Xyz",
+                     NameUtil.mangleNameToVariableName("abc100xyz"));
+        assertEquals("nameUtilTest",
+                     NameUtil.mangleNameToVariableName("name_util_test"));
+        assertEquals("nameUtil",
+                     NameUtil.mangleNameToVariableName("NameUtil"));
+        assertEquals("int",
+                     NameUtil.mangleNameToVariableName("int"));
+    }
+
+    public void testIsJavaIdentifier() {
+        assertFalse(NameUtil.isJavaIdentifier("int"));
+    }
+}

Propchange: incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/common/src/test/java/org/apache/cxf/tools/util/NameUtilTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java (original)
+++ incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java Wed Jan 10 05:37:31 2007
@@ -65,7 +65,6 @@
 import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
-import org.apache.cxf.tools.util.WSDLExtensionRegister;
 
 public class SchemaValidator extends AbstractValidator {
     
@@ -225,8 +224,10 @@
                 WSDLFactory wsdlFactory = WSDLFactory.newInstance();
                 WSDLReader reader = wsdlFactory.newWSDLReader();
                 reader.setFeature("javax.wsdl.verbose", false);
-                WSDLExtensionRegister register = new WSDLExtensionRegister(wsdlFactory, reader);
-                register.registerExtensions();
+                // REVIST: Get the wsdl builder from the frontend which loaded by the plugin
+                //         Extension should be done in the builder
+                // WSDLExtensionRegister register = new WSDLExtensionRegister(wsdlFactory, reader);
+                // register.registerExtensions();
                 def = reader.readWSDL(wsdlsource.getSystemId());
             } catch (WSDLException e) {
                 throw new ToolException(e);

Copied: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java (from r494755, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java?view=diff&rev=494811&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java&r1=494755&p2=incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/AbstractGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java Wed Jan 10 05:37:31 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.frontend.jaxws;
+package org.apache.cxf.tools.wsdlto.core;
 
 import java.io.IOException;
 import java.io.Writer;
@@ -42,20 +42,13 @@
 
 public abstract class AbstractGenerator implements FrontEndGenerator {
 
-    public static final String TEMPLATE_BASE = "org/apache/cxf/tools/wsdl2java/frontend/jaxws/template";
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
     protected ToolContext env;
-    //protected JavaModel javaModel;
     protected Map<String, Object> attributes = new HashMap<String, Object>();
     protected String name;
-    //protected ClassCollector collector;
 
     public AbstractGenerator() {
     }
-
-    public abstract boolean passthrough();
-
-    public abstract void generate(ToolContext penv) throws ToolException;
 
     protected void doWrite(String templateName, Writer outputs) throws ToolException {
         Template tmpl = null;

Copied: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/VelocityWriter.java (from r494755, incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/VelocityWriter.java?view=diff&rev=494811&p1=incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java&r1=494755&p2=incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/VelocityWriter.java&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/frontend/jaxws/VelocityWriter.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/VelocityWriter.java Wed Jan 10 05:37:31 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.wsdl2java.frontend.jaxws;
+package org.apache.cxf.tools.wsdlto.core;
 
 import java.io.BufferedWriter;
 import java.io.IOException;

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java Wed Jan 10 05:37:31 2007
@@ -25,7 +25,8 @@
 
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.util.NameUtil;
+import org.apache.cxf.tools.util.URIParserUtil;
 
 public class ClassNameAllocatorImpl implements ClassNameAllocator {
     private static final String TYPE_SUFFIX = "_Type";
@@ -51,8 +52,8 @@
         QName portType = seiInfo.getName();
         String ns = portType.getNamespaceURI();
         String type = portType.getLocalPart();
-        String pkgName = ProcessorUtil.parsePackageName(ns, packageName);
-        String className = ProcessorUtil.mangleNameToClassName(type);
+        String pkgName = URIParserUtil.parsePackageName(ns, packageName);
+        String className = NameUtil.mangleNameToClassName(type);
         String fullClassName = pkgName + "." + className;
         if (packageName == null) {
             packageName = pkgName;

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java Wed Jan 10 05:37:31 2007
@@ -49,8 +49,9 @@
 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.ProcessorUtil;
+import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+
 public class JAXBDataBinding implements DataBindingProfile {
     private static final Logger LOG = LogUtils.getL7dLogger(JAXBDataBinding.class);
     private static S2JJAXBModel rawJaxbModelGenCode;
@@ -105,7 +106,7 @@
             if (StringUtils.isEmpty(targetNamespace)) {
                 continue;
             }
-            String packageName = ProcessorUtil.parsePackageName(targetNamespace, null);
+            String packageName = URIParserUtil.parsePackageName(targetNamespace, null);
             if (!addedToClassCollector(packageName)) {
                 allocator.assignClassName(packageName, "*");
             }

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/CustomizationParser.java Wed Jan 10 05:37:31 2007
@@ -53,8 +53,8 @@
 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;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
 public final class CustomizationParser {
     // For WSDL1.1

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractJAXWSGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractJAXWSGenerator.java?view=auto&rev=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractJAXWSGenerator.java (added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AbstractJAXWSGenerator.java Wed Jan 10 05:37:31 2007
@@ -0,0 +1,32 @@
+/**
+ * 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.generators;
+
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.wsdlto.core.AbstractGenerator;
+
+public abstract class AbstractJAXWSGenerator extends AbstractGenerator {
+    protected static final String TEMPLATE_BASE = "org/apache/cxf/tools/wsdlto/frontend/jaxws/template";
+
+    public abstract boolean passthrough();
+    
+    public abstract void generate(ToolContext penv) throws ToolException;
+}

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

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

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/AntGenerator.java Wed Jan 10 05:37:31 2007
@@ -24,7 +24,7 @@
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JavaModel;
 
-public class AntGenerator extends AbstractGenerator {
+public class AntGenerator extends AbstractJAXWSGenerator {
 
     private static final String ANT_TEMPLATE = TEMPLATE_BASE + "/build.vm";
 
@@ -43,7 +43,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ClientGenerator.java Wed Jan 10 05:37:31 2007
@@ -30,7 +30,7 @@
 import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 
-public class ClientGenerator extends AbstractGenerator {
+public class ClientGenerator extends AbstractJAXWSGenerator {
 
     private static final String CLT_TEMPLATE = TEMPLATE_BASE + "/client.vm";
 
@@ -59,7 +59,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultGenerator.java Wed Jan 10 05:37:31 2007
@@ -28,9 +28,9 @@
 import org.apache.cxf.tools.common.model.JavaExceptionClass;
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.common.model.JavaModel;
-import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
-public class FaultGenerator extends AbstractGenerator {
+public class FaultGenerator extends AbstractJAXWSGenerator {
 
     private static final String FAULT_TEMPLATE = TEMPLATE_BASE + "/fault.vm";
 
@@ -58,7 +58,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java Wed Jan 10 05:37:31 2007
@@ -25,7 +25,7 @@
 import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 
-public class HandlerConfigGenerator extends AbstractGenerator {
+public class HandlerConfigGenerator extends AbstractJAXWSGenerator {
 
     //private static final String HANDLER_CHAIN_NAME = "";
    // private JavaInterface intf;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java Wed Jan 10 05:37:31 2007
@@ -30,7 +30,7 @@
 import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 
-public class ImplGenerator extends AbstractGenerator {
+public class ImplGenerator extends AbstractJAXWSGenerator {
 
     private static final String IMPL_TEMPLATE = TEMPLATE_BASE + "/impl.vm";
 
@@ -61,7 +61,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java Wed Jan 10 05:37:31 2007
@@ -28,7 +28,7 @@
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
 
-public class SEIGenerator extends AbstractGenerator {
+public class SEIGenerator extends AbstractJAXWSGenerator {
 
     private static final String SEI_TEMPLATE = TEMPLATE_BASE + "/sei.vm";
 
@@ -62,7 +62,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;
@@ -91,4 +91,4 @@
             doWrite(SEI_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName()));
         }
     }
-}
\ No newline at end of file
+}

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServerGenerator.java Wed Jan 10 05:37:31 2007
@@ -30,7 +30,7 @@
 import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 
-public class ServerGenerator extends AbstractGenerator {
+public class ServerGenerator extends AbstractJAXWSGenerator {
 
     private static final String SRV_TEMPLATE = TEMPLATE_BASE + "/server.vm";
 
@@ -57,7 +57,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java Wed Jan 10 05:37:31 2007
@@ -28,7 +28,7 @@
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 
-public class ServiceGenerator extends AbstractGenerator {
+public class ServiceGenerator extends AbstractJAXWSGenerator {
     //private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
     private static final String SERVICE_TEMPLATE = TEMPLATE_BASE + "/service.vm";
 
@@ -54,7 +54,7 @@
 
     public void generate(ToolContext penv) throws ToolException {
         this.env = penv;
-        JavaModel javaModel = env.getJavaModel();
+        JavaModel javaModel = env.get(JavaModel.class);
 
         if (passthrough()) {
             return;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/WSDLToJavaProcessor.java Wed Jan 10 05:37:31 2007
@@ -27,7 +27,6 @@
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.wsdlto.core.WSDLToProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor;
-//import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.SEIAnnotationProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.BindingAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebServiceAnnotator;
@@ -58,15 +57,10 @@
         ServiceProcessor serviceProcessor = new ServiceProcessor(context);
         serviceProcessor.process(serviceInfo);
 
-        //         SEIAnnotationProcessor seiAnnotationProcessor = new SEIAnnotationProcessor(context);
-        //         seiAnnotationProcessor.process(serviceInfo);
-
         JavaInterface intf = javaModel.getInterfaces().values().iterator().next();
         intf.annotate(new WebServiceAnnotator());
-        //new WebServiceAnnotator().annotate(intf);
         if (serviceInfo.getBindings().size() > 0) {
             intf.annotate(new BindingAnnotator());
-            //new BindingAnnotator().annotate(intf);
         }
 
 

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java Wed Jan 10 05:37:31 2007
@@ -33,7 +33,7 @@
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.util.ClassCollector;
-
+import org.apache.cxf.tools.util.NameUtil;
 
 public class FaultProcessor extends AbstractProcessor {
     private ClassCollector  collector;
@@ -65,7 +65,7 @@
     @SuppressWarnings("unchecked")
     private void processFault(JavaMethod method, FaultInfo faultMessage) throws ToolException {
         JavaModel model = method.getInterface().getJavaModel();
-        String name = ProcessorUtil.mangleNameToClassName(faultMessage.getName().getLocalPart());
+        String name = NameUtil.mangleNameToClassName(faultMessage.getName().getLocalPart());
         //Fix issue 305770
         String namespace = faultMessage.getName().getNamespaceURI();
         String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java Wed Jan 10 05:37:31 2007
@@ -26,7 +26,6 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.StringTokenizer;
 
 import javax.xml.namespace.QName;
 
@@ -36,14 +35,13 @@
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
-import com.sun.xml.bind.api.JAXBRIContext;
-
 import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.jaxb.JAXBUtils;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.util.ClassCollector;
+import org.apache.cxf.tools.util.NameUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
@@ -60,7 +58,7 @@
     }
 
     public static String resolvePartName(MessagePartInfo part) {
-        return mangleNameToVariableName(part.getName().getLocalPart());
+        return NameUtil.mangleNameToVariableName(part.getName().getLocalPart());
     }
 
     public static String getPartType(MessagePartInfo part) {
@@ -68,7 +66,7 @@
     }
 
     public static String resolvePartType(MessagePartInfo part) {
-        return mangleNameToClassName(getPartType(part));
+        return NameUtil.mangleNameToClassName(getPartType(part));
     }
     
     public static String getType(MessagePartInfo part, ToolContext context, boolean fullname) {
@@ -129,12 +127,8 @@
         return part.getConcreteName().getNamespaceURI();
     }
 
-    public static String mangleNameToClassName(String clzName) {
-        return JAXBRIContext.mangleNameToClassName(clzName);
-    }
-
     public static String mangleNameToVariableName(String vName) {
-        String result  = JAXBRIContext.mangleNameToVariableName(vName);
+        String result  = NameUtil.mangleNameToVariableName(vName);
         if (JavaUtils.isJavaKeyword(result)) {
             return KEYWORDS_PREFIX + result;
         } else {
@@ -171,30 +165,6 @@
 
     private static String resolvePath(String path) {
         return path.replace('\\', '/');
-    }
-
-    public static URL[] pathToURLs(String path) {
-        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
-        URL[] urls = new URL[st.countTokens()];
-        int count = 0;
-        while (st.hasMoreTokens()) {
-            File file = new File(st.nextToken());
-            URL url = null;
-            try {
-                url = file.toURL();
-            } catch (MalformedURLException e) {
-                e.printStackTrace();
-            }
-            if (url != null) {
-                urls[count++] = url;
-            }
-        }
-        if (urls.length != count) {
-            URL[] tmp = new URL[count];
-            System.arraycopy(urls, 0, tmp, 0, count);
-            urls = tmp;
-        }
-        return urls;
     }
 
     public static String classNameToFilePath(String className) {

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java Wed Jan 10 05:37:31 2007
@@ -53,7 +53,7 @@
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.util.NameUtil;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.customiztion.JAXWSBinding;
 
@@ -100,7 +100,7 @@
 
     private void processService(JavaModel model) throws ToolException {
         JavaServiceClass sclz = new JavaServiceClass(model);
-        String name = ProcessorUtil.mangleNameToClassName(service.getName().getLocalPart());
+        String name = NameUtil.mangleNameToClassName(service.getName().getLocalPart());
         String namespace = service.getName().getNamespaceURI();
         String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));
 
@@ -150,7 +150,7 @@
     }
 
     private JavaPort processPort(JavaModel model, EndpointInfo port) throws ToolException {
-        JavaPort jport = new JavaPort(ProcessorUtil.mangleNameToClassName(port.getName().getLocalPart()));
+        JavaPort jport = new JavaPort(NameUtil.mangleNameToClassName(port.getName().getLocalPart()));
         jport.setPortName(port.getName().getLocalPart());
         BindingInfo binding = port.getBinding();
         jport.setBindingAdress(port.getAddress());
@@ -177,10 +177,10 @@
         
         if (infBinding != null && infBinding.getJaxwsClass() != null 
             && infBinding.getJaxwsClass().getClassName() != null) {
-            String className = ProcessorUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
+            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
             jport.setInterfaceClass(className);
         } else {
-            jport.setInterfaceClass(ProcessorUtil.mangleNameToClassName(portType));
+            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
         }
 
         bindingType = getBindingType(binding);
@@ -224,8 +224,7 @@
             }
         }
              
-        String portType = ProcessorUtil
-            .mangleNameToClassName(binding.getInterface().getName().getLocalPart());
+        String portType = NameUtil.mangleNameToClassName(binding.getInterface().getName().getLocalPart());
         
         JavaInterface jf = model.getInterfaces().get(portType);
        

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/InterfaceMapper.java Wed Jan 10 05:37:31 2007
@@ -23,10 +23,9 @@
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.model.JavaInterface;
+import org.apache.cxf.tools.util.NameUtil;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
-
-
 public final class InterfaceMapper {
     //private static final Logger LOG = LogUtils.getL7dLogger(InterfaceMapper.class);
     private ToolContext context;
@@ -44,7 +43,7 @@
         String webServiceName = interfaceInfo.getName().getLocalPart();
 
         intf.setWebServiceName(webServiceName);
-        intf.setName(ProcessorUtil.mangleNameToClassName(webServiceName));
+        intf.setName(NameUtil.mangleNameToClassName(webServiceName));
         intf.setNamespace(namespace);
         intf.setPackageName(packageName);
         intf.setLocation(loc);

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java?view=diff&rev=494811&r1=494810&r2=494811
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java (original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/mapper/MethodMapper.java Wed Jan 10 05:37:31 2007
@@ -23,7 +23,7 @@
 
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.tools.common.model.JavaMethod;
-import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
 public final class MethodMapper {
     



Mime
View raw message