cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r608552 [1/2] - in /incubator/cxf/branches/2.0.x-fixes: ./ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ tools/common/ tools/common/src/main/java/org/apache/cxf/tools/common/model/ tools/common/src/test/java/org/ap...
Date Thu, 03 Jan 2008 16:34:40 GMT
Author: dkulp
Date: Thu Jan  3 08:34:38 2008
New Revision: 608552

URL: http://svn.apache.org/viewvc?rev=608552&view=rev
Log:
Fix compile/build failures on 2.0.x branch. 

Added:
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotation.java
      - copied unchanged from r586360, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotation.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
      - copied unchanged from r586360, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/A.java
      - copied unchanged from r586360, incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/model/A.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java
      - copied, changed from r586360, incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/wsdl_addr.wsdl
      - copied unchanged from r586360, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/wsdl_addr.wsdl
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
    incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/pom.xml
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaField.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotatorTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotatorTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotatorTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotatorTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-blocked' - no diff available.

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Thu Jan  3 08:34:38 2008
@@ -87,16 +87,6 @@
      */
     boolean useCompileClasspath;
 
-    private List<WsdlOption> getWsdlOptionsFromDir(final File root) throws MojoExecutionException {
-        List<WsdlOption> options = new ArrayList<WsdlOption>();
-        for (WsdlOption o : new WsdlOptionLoader().load(root)) {
-            if (!options.contains(o)) {
-                options.add(o);
-            }
-        }
-        return options;
-    }
-
     public void execute() throws MojoExecutionException {
         String outputDir = testSourceRoot == null ? sourceRoot : testSourceRoot;
         File outputDirFile = new File(outputDir);
@@ -105,27 +95,22 @@
         File classesDir = new File(classesDirectory);
         classesDir.mkdirs();
 
-        List<WsdlOption> options = new ArrayList<WsdlOption>();
-        if (wsdlRoot == null) {
-            File sourceWsdlRoot = new File(project.getBasedir(), "/src/main/resources/wsdl");
-            if (sourceWsdlRoot.exists()) {
-                options.addAll(getWsdlOptionsFromDir(sourceWsdlRoot));
-            }
 
-            File testWsdlRoot = new File(project.getBasedir(), "/src/test/resources/wsdl");
-            if (testWsdlRoot.exists()) {
-                options.addAll(getWsdlOptionsFromDir(testWsdlRoot));
+        if (wsdlRoot != null) {
+            List<WsdlOption> options = new ArrayList<WsdlOption>();
+            if (wsdlOptions != null) {
+                options.addAll(Arrays.asList(wsdlOptions));
             }
-        } else {
-            options.addAll(getWsdlOptionsFromDir(new File(wsdlRoot)));
-        }
-
-        if (wsdlOptions != null) {
-            options.addAll(Arrays.asList(wsdlOptions));
+            
+            for (WsdlOption o : new WsdlOptionLoader().load(wsdlRoot)) {
+                if (!options.contains(o)) {
+                    options.add(o);
+                }
+            }
+            wsdlOptions = options.toArray(new WsdlOption[options.size()]);
         }
-        wsdlOptions = options.toArray(new WsdlOption[options.size()]);
 
-        if (wsdlOptions.length == 0) {
+        if (wsdlOptions == null) {
             getLog().info("Nothing to generate");
             return;
         }

Modified: incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WsdlOptionLoader.java Thu Jan  3 08:34:38 2008
@@ -38,16 +38,14 @@
     private static final String WSDL_BINDINGS = "-binding-?\\d*.xml$";
 
     public List<WsdlOption> load(String wsdlRoot) throws MojoExecutionException {
-        return load(new File(wsdlRoot));
-    }
-
-    public List<WsdlOption> load(File wsdlBasedir) throws MojoExecutionException {
-        if (wsdlBasedir == null) {
+        File wsdlBasedir;
+        if (wsdlRoot == null) {
             return new ArrayList<WsdlOption>();
         }
+        wsdlBasedir = new File(wsdlRoot);
 
         if (!wsdlBasedir.exists()) {
-            throw new MojoExecutionException(wsdlBasedir + " not exists");
+            throw new MojoExecutionException(wsdlRoot + " not exists");
         }
 
         return findJobs(wsdlBasedir, getWsdlFiles(wsdlBasedir));

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/pom.xml?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/pom.xml (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/pom.xml Thu Jan  3 08:34:38 2008
@@ -88,6 +88,12 @@
 	    <version>${project.version}</version>
 	</dependency>
 
+	<dependency>
+                <groupId>javax.xml.ws</groupId>
+                <artifactId>jaxws-api</artifactId>
+		<scope>test</scope>
+	</dependency>
+
     </dependencies>
 
 

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaField.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaField.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaField.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaField.java Thu Jan  3 08:34:38 2008
@@ -19,11 +19,16 @@
 
 package org.apache.cxf.tools.common.model;
 
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.cxf.tools.util.URIParserUtil;
 
 public class JavaField extends JavaType implements JavaAnnotatable {
     private String modifier;
-    private JavaAnnotation annotation;
+    private List<JAnnotation> annotations = new ArrayList<JAnnotation>();
+    private Annotation[] jaxbAnnotations;
 
     public JavaField() {
     }
@@ -41,12 +46,15 @@
         this.modifier = modi;
     }
 
-    public void setAnnotation(JavaAnnotation anno) {
-        this.annotation = anno;
+    public void addAnnotation(JAnnotation anno) {
+        annotations.add(anno);
+        for (String importClz : anno.getImports()) {
+            getOwner().addImport(importClz);
+        }        
     }
 
-    public JavaAnnotation getAnnotation() {
-        return this.annotation;
+    public List<JAnnotation> getAnnotations() {
+        return this.annotations;
     }
 
     public void annotate(Annotator annotator) {
@@ -58,6 +66,17 @@
             return "_" + this.name;
         }*/
         return this.name;
+    }
+    
+    public void setJaxbAnnotations(Annotation[] anns) {
+        jaxbAnnotations = anns;
+    }
+    
+    public Annotation[] getJaxbAnnotaions() {
+        if (jaxbAnnotations == null) {
+            return new Annotation[]{};
+        } 
+        return jaxbAnnotations;
     }
     
     public String getParaName() {

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java Thu Jan  3 08:34:38 2008
@@ -38,7 +38,7 @@
     private SOAPBinding.ParameterStyle soapParameterStyle;
     
     private final List<JavaMethod> methods = new ArrayList<JavaMethod>();
-    private final List<String> annotations = new ArrayList<String>();
+    private final List<JAnnotation> annotations = new ArrayList<JAnnotation>();
     private final Set<String> imports = new TreeSet<String>();
 
     private String webserviceName;
@@ -168,17 +168,30 @@
         this.namespace = ns;
     }
 
-    public void addAnnotation(String annotation) {
+    public void addAnnotation(JAnnotation annotation) {
         this.annotations.add(annotation);
+        for (String importClz : annotation.getImports()) {
+            addImport(importClz);
+        }        
     }
 
-    public List<String> getAnnotations() {
+    public List<JAnnotation> getAnnotations() {
         return this.annotations;
     }
 
     public void addImport(String i) {
+        if (i != null && i.lastIndexOf(".") != -1 && getPackageName() != null
+            && getPackageName().equals(i.substring(0, i.lastIndexOf(".")))) {
+            return;
+        }
         imports.add(i);
     }
+    
+    public void addImports(Collection<String> ii) {
+        for (String i : ii) {
+            imports.add(i);
+        }
+    }
 
     public Iterator<String> getImports() {
         return imports.iterator();
@@ -216,7 +229,7 @@
 
     public String toString() {
         StringBuffer sb = new StringBuffer();
-        for (String anno : annotations) {
+        for (JAnnotation anno : annotations) {
             sb.append(anno);
             sb.append("\n");
         }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java Thu Jan  3 08:34:38 2008
@@ -47,7 +47,7 @@
     private JavaInterface javaInterface;
     private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
     private final List<JavaException> exceptions = new ArrayList<JavaException>();
-    private final Map<String, JavaAnnotation> annotations = new HashMap<String, JavaAnnotation>();
+    private final Map<String, JAnnotation> annotations = new HashMap<String, JAnnotation>();
 
     private JavaCodeBlock block;
 
@@ -109,6 +109,11 @@
         return javaReturn;
     }
 
+    public String getReturnValue() {
+        String value = getClassName(javaReturn);
+        return value == null ? "void" : value;
+    }
+
     public void setReturn(JavaReturn rt) {
         if (rt != null && rt.getType() == null && rt.getClassName() == null) {
             Message msg = new Message("FAIL_TO_CREATE_JAVA_OUTPUT_PARAMETER", LOG, rt.name, this.getName());
@@ -149,7 +154,7 @@
             Message msg = new Message("FAIL_TO_CREATE_JAVA_PARAMETER", LOG, param.name, this.getName());
             throw new ToolException(msg);
         }
-        
+        param.setMethod(this);
         parameters.add(param);
     }
 
@@ -240,18 +245,22 @@
         return this.soapUse;
     }
 
-    public void addAnnotation(String tag, JavaAnnotation annotation) {
+    public void addAnnotation(String tag, JAnnotation annotation) {
         if (annotation == null) {
             return;
         }
         this.annotations.put(tag, annotation);
+        
+        for (String importClz : annotation.getImports()) {
+            getInterface().addImport(importClz);
+        }
     }
 
-    public Collection<JavaAnnotation> getAnnotations() {
+    public Collection<JAnnotation> getAnnotations() {
         return this.annotations.values();
     }
 
-    public Map<String, JavaAnnotation> getAnnotationMap() {
+    public Map<String, JAnnotation> getAnnotationMap() {
         return this.annotations;
     }
 
@@ -263,6 +272,16 @@
         return getParameterList(false);
     }
 
+    private String getClassName(JavaType type) {
+        if (getInterface() == null || getInterface().getPackageName() == null) {
+            return type.getClassName();
+        }
+        if (getInterface().getPackageName().equals(type.getPackageName())) {
+            return type.getSimpleName();
+        }
+        return type.getClassName();
+    }
+
     public List<String> getParameterList(boolean includeAnnotation) {
         List<String> list = new ArrayList<String>();
         StringBuffer sb = new StringBuffer();
@@ -275,10 +294,10 @@
             if (parameter.isHolder()) {
                 sb.append(parameter.getHolderName());
                 sb.append("<");
-                sb.append(parameter.getClassName());
+                sb.append(getClassName(parameter));
                 sb.append(">");
             } else {
-                sb.append(parameter.getClassName());
+                sb.append(getClassName(parameter));
             }
             sb.append(" ");
             sb.append(parameter.getName());

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaParameter.java Thu Jan  3 08:34:38 2008
@@ -24,7 +24,7 @@
 
     private boolean holder;
     private String holderName;
-    private JavaAnnotation annotation;
+    private JAnnotation annotation;
     private String partName;
 
     private JavaMethod javaMethod;
@@ -57,11 +57,14 @@
         this.holderName = hn;
     }
 
-    public void setAnnotation(JavaAnnotation anno) {
+    public void setAnnotation(JAnnotation anno) {
         this.annotation = anno;
+        for (String importClz : annotation.getImports()) {
+            getMethod().getInterface().addImport(importClz);
+        }        
     }
 
-    public JavaAnnotation getAnnotation() {
+    public JAnnotation getAnnotation() {
         return this.annotation;
     }
 

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaPort.java Thu Jan  3 08:34:38 2008
@@ -22,6 +22,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import javax.jws.soap.SOAPBinding;
+import org.apache.cxf.common.util.StringUtils;
 
 public class JavaPort {
     
@@ -149,5 +150,14 @@
     public String getMethodName(String mname) {
         return methodName;
     }
-    
+
+    public String getFullClassName() {
+        StringBuffer sb = new StringBuffer();
+        if (!StringUtils.isEmpty(getPackageName())) {
+            sb.append(getPackageName());
+            sb.append(".");
+        }
+        sb.append(getInterfaceClass());
+        return sb.toString();
+    }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaType.java Thu Jan  3 08:34:38 2008
@@ -48,14 +48,14 @@
         typeMapping.put("java.math.BigInteger", "new java.math.BigInteger(\"0\")");
         typeMapping.put("java.math.BigDecimal", "new java.math.BigDecimal(\"0\")");
         typeMapping.put("javax.xml.datatype.XMLGregorianCalendar", "null");
-        // javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar()
         typeMapping.put("javax.xml.datatype.Duration", "null");
-        // javax.xml.datatype.DatatypeFactory.newInstance().newDuration(\"P1Y35DT60M60.500S\")
     }
 
     protected String name;
     protected String type;
+    protected String packageName;
     protected String className;
+    protected String simpleName;
     protected String targetNamespace;
     protected Style style;
     protected boolean isHeader;
@@ -63,6 +63,7 @@
     private JavaInterface owner;
     private DefaultValueWriter dvw;
 
+
     public JavaType() {
     }
 
@@ -71,7 +72,7 @@
         this.type = t;
         this.targetNamespace = tns;
         this.className = t;
-    }
+    }    
 
     public void setDefaultValueWriter(DefaultValueWriter w) {
         dvw = w;
@@ -90,6 +91,18 @@
 
     public void setClassName(String clzName) {
         this.className = clzName;
+        resolvePackage(clzName);
+    }
+
+    private void resolvePackage(String clzName) {
+        if (clzName == null || clzName.lastIndexOf(".") == -1) {
+            this.packageName = "";
+            this.simpleName = clzName;
+        } else {
+            int index = clzName.lastIndexOf(".");
+            this.packageName = clzName.substring(0, index);
+            this.simpleName = clzName.substring(index + 1);
+        }
     }
 
     public String getClassName() {
@@ -223,5 +236,13 @@
 
     public void setOwner(JavaInterface intf) {
         this.owner = intf;
+    }
+
+    public String getPackageName() {
+        return this.packageName;
+    }
+
+    public String getSimpleName() {
+        return this.simpleName;
     }
 }

Copied: incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java (from r586360, incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java?p2=incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java&p1=incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java&r1=586360&r2=608552&rev=608552&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/test/java/org/apache/cxf/tools/common/model/JAnnotationTest.java Thu Jan  3 08:34:38 2008
@@ -19,29 +19,16 @@
 
 package org.apache.cxf.tools.common.model;
 
-import java.util.Arrays;
 import javax.jws.WebParam;
 import javax.jws.WebParam.Mode;
 import javax.jws.WebService;
 import javax.jws.soap.SOAPBinding;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.ws.Action;
-import javax.xml.ws.FaultAction;
 
 import org.junit.Assert;
 import org.junit.Test;
 
 public class JAnnotationTest extends Assert {
     @Test
-    public void testList() throws Exception {
-        JAnnotation annotation = new JAnnotation(XmlSeeAlso.class);
-        annotation.addElement(new JAnnotationElement(null, 
-                                                            Arrays.asList(new Class[]{XmlSeeAlso.class})));
-        assertEquals("@XmlSeeAlso({XmlSeeAlso.class})", annotation.toString());
-        assertEquals("javax.xml.bind.annotation.XmlSeeAlso", annotation.getImports().iterator().next());
-    }
-
-    @Test
     public void testSimpleForm() {
         JAnnotation annotation = new JAnnotation(WebService.class);
         assertEquals("@WebService", annotation.toString());
@@ -64,28 +51,6 @@
         assertEquals("@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)", annotation.toString());
     }
     
-    @Test
-    public void testCombination() {
-        JAnnotation annotation = new JAnnotation(Action.class);
-        annotation.addElement(new JAnnotationElement("input", "3in"));
-        annotation.addElement(new JAnnotationElement("output", "3out"));
-        
-        
-        JAnnotation faultAction = new JAnnotation(FaultAction.class);
-        faultAction.addElement(new JAnnotationElement("className", A.class));
-        faultAction.addElement(new JAnnotationElement("value", "3fault"));
-        
-        annotation.addElement(new JAnnotationElement("fault", 
-                                                            Arrays.asList(new JAnnotation[]{faultAction})));
-
-        String expected = "@Action(input = \"3in\", output = \"3out\", " 
-            + "fault = {@FaultAction(className = A.class, value = \"3fault\")})";
-        assertEquals(expected, annotation.toString());
-
-        assertTrue(annotation.getImports().contains("javax.xml.ws.FaultAction"));
-        assertTrue(annotation.getImports().contains("javax.xml.ws.Action"));
-        assertTrue(annotation.getImports().contains("org.apache.cxf.tools.common.model.A"));
-    }
 
     @Test
     public void testPrimitive() {

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,39 +19,44 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
 public class WrapperBeanAnnotator implements Annotator {
 
     public void annotate(final JavaAnnotatable clz) {
-        WrapperBeanClass wrapperBeanClass = null;
+        WrapperBeanClass beanClass = null;
         if (clz instanceof WrapperBeanClass) {
-            wrapperBeanClass = (WrapperBeanClass) clz;
+            beanClass = (WrapperBeanClass) clz;
         } else {
             throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
         }
 
-        JavaAnnotation xmlRootElement = new JavaAnnotation("XmlRootElement");
-        xmlRootElement.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlRootElement.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
-
-        JavaAnnotation xmlAccessorType = new JavaAnnotation("XmlAccessorType");
-        xmlAccessorType.addArgument("XmlAccessType.FIELD", "null", "");
+        JAnnotation xmlRootElement = new JAnnotation(XmlRootElement.class);
+        xmlRootElement.addElement(new JAnnotationElement("name", 
+                                                         beanClass.getElementName().getLocalPart()));
+        xmlRootElement.addElement(new JAnnotationElement("namespace", 
+                                                         beanClass.getElementName().getNamespaceURI()));
+        
+        JAnnotation xmlAccessorType = new JAnnotation(XmlAccessorType.class);
+        xmlAccessorType.addElement(new JAnnotationElement(null, XmlAccessType.FIELD));
 
-        JavaAnnotation xmlType = new JavaAnnotation("XmlType");
-        //xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
+        JAnnotation xmlType = new JAnnotation(XmlType.class);
+        xmlType.addElement(new JAnnotationElement("name", 
+                                                  beanClass.getElementName().getLocalPart()));
+        xmlType.addElement(new JAnnotationElement("namespace", 
+                                                  beanClass.getElementName().getNamespaceURI()));
+        
         // Revisit: why annotation is string?
-        wrapperBeanClass.addAnnotation(xmlRootElement.toString());
-        wrapperBeanClass.addAnnotation(xmlAccessorType.toString());
-        wrapperBeanClass.addAnnotation(xmlType.toString());
-
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessorType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlRootElement");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlType");
+        beanClass.addAnnotation(xmlRootElement);
+        beanClass.addAnnotation(xmlAccessorType);
+        beanClass.addAnnotation(xmlType);
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,9 +19,19 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import java.lang.annotation.Annotation;
+
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlList;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaField;
 
 public class WrapperBeanFieldAnnotator implements Annotator {
@@ -34,12 +44,32 @@
             throw new RuntimeException("WrapperBeanFiledAnnotator expect JavaField as input");
         }
         String rawName = jField.getRawName();
-        JavaAnnotation xmlElementAnnotation = new JavaAnnotation("XmlElement");
-        
-        xmlElementAnnotation.addArgument("name", rawName);
-        xmlElementAnnotation.addArgIgnoreEmpty("namespace", jField.getTargetNamespace(), "\"");
+        JAnnotation xmlElementAnnotation = new JAnnotation(XmlElement.class);
+        xmlElementAnnotation.addElement(new JAnnotationElement("name", rawName));
+        if (!StringUtils.isEmpty(jField.getTargetNamespace())) {
+            xmlElementAnnotation.addElement(new JAnnotationElement("namespace", 
+                                                                          jField.getTargetNamespace()));
+        }
 
-        jField.setAnnotation(xmlElementAnnotation);
-        jField.getOwner().addImport("javax.xml.bind.annotation.XmlElement");
+        jField.addAnnotation(xmlElementAnnotation);
+        
+        for (Annotation ann : jField.getJaxbAnnotaions()) {
+            if (ann instanceof XmlMimeType) {
+                JAnnotation mimeAnno = new JAnnotation(XmlMimeType.class);
+                mimeAnno.addElement(new JAnnotationElement("value", ((XmlMimeType)ann).value()));
+                jField.addAnnotation(mimeAnno);
+            } else if (ann instanceof XmlJavaTypeAdapter) {           
+                JAnnotation jaxbAnn = new JAnnotation(XmlJavaTypeAdapter.class);
+                jaxbAnn.addElement(new JAnnotationElement("value", ((XmlJavaTypeAdapter)ann).value()));
+                jaxbAnn.addElement(new JAnnotationElement("type", ((XmlJavaTypeAdapter)ann).type()));
+                jField.addAnnotation(jaxbAnn);
+            } else if (ann instanceof XmlAttachmentRef) {
+                JAnnotation jaxbAnn = new JAnnotation(XmlAttachmentRef.class);
+                jField.addAnnotation(jaxbAnn);
+            } else if (ann instanceof XmlList) {
+                JAnnotation jaxbAnn = new JAnnotation(XmlList.class);
+                jField.addAnnotation(jaxbAnn);
+            }
+        }
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotatorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotatorTest.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotatorTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotatorTest.java Thu Jan  3 08:34:38 2008
@@ -23,6 +23,7 @@
 import javax.xml.namespace.QName;
 
 
+import org.apache.cxf.tools.common.model.JAnnotation;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
 import org.junit.Assert;
 import org.junit.Test;
@@ -37,29 +38,44 @@
         clz.setElementName(new QName("http://doc.withannotation.fortest.tools.cxf.apache.org/", "sayHi"));
 
         clz.annotate(new WrapperBeanAnnotator());
-        List<String> annotations = clz.getAnnotations();
+        List<JAnnotation> annotations = clz.getAnnotations();
         
         String expectedNamespace = "http://doc.withannotation.fortest.tools.cxf.apache.org/";
+                
+        JAnnotation rootElementAnnotation = annotations.get(0);
+        assertEquals("@XmlRootElement(name = \"sayHi\", " 
+                     + "namespace = \"" + expectedNamespace + "\")", 
+                     rootElementAnnotation.toString());
         
-        assertTrue(annotations.contains("@XmlRootElement(namespace = \""
-                                        + expectedNamespace + "\", name = \"sayHi\")"));
-        assertTrue(annotations.contains("@XmlType(namespace = \""
-                                        + expectedNamespace + "\", name = \"sayHi\")"));
-        assertTrue(annotations.contains("@XmlAccessorType(XmlAccessType.FIELD)"));
-
+        JAnnotation xmlTypeAnnotation = annotations.get(2);
+        assertEquals("@XmlType(name = \"sayHi\", "
+                     + "namespace = \"" + expectedNamespace + "\")", 
+                     xmlTypeAnnotation.toString());
+        
+        JAnnotation accessorTypeAnnotation = annotations.get(1);
+        assertEquals("@XmlAccessorType(XmlAccessType.FIELD)", 
+                     accessorTypeAnnotation.toString());
         
         WrapperBeanClass resWrapperClass = new WrapperBeanClass();
         resWrapperClass.setFullClassName(pkgName + ".SayHiResponse");
-        resWrapperClass.setElementName(new QName("http://doc.withannotation.fortest.tools.cxf.apache.org/",
+        resWrapperClass.setElementName(new QName(expectedNamespace,
                                      "sayHiResponse"));
         
         resWrapperClass.annotate(new WrapperBeanAnnotator());
         annotations = resWrapperClass.getAnnotations();
         
-        assertTrue(annotations.contains("@XmlRootElement(namespace = \""
-                                        + expectedNamespace + "\", name = \"sayHiResponse\")"));
-        assertTrue(annotations.contains("@XmlType(namespace = \""
-                                        + expectedNamespace + "\", name = \"sayHiResponse\")"));
-        assertTrue(annotations.contains("@XmlAccessorType(XmlAccessType.FIELD)"));
+        rootElementAnnotation = annotations.get(0);
+        assertEquals("@XmlRootElement(name = \"sayHiResponse\", " 
+                     + "namespace = \"" + expectedNamespace + "\")", 
+                     rootElementAnnotation.toString());
+        
+        accessorTypeAnnotation = annotations.get(1);
+        assertEquals("@XmlAccessorType(XmlAccessType.FIELD)", 
+                     accessorTypeAnnotation.toString());
+        
+        xmlTypeAnnotation = annotations.get(2);
+        assertEquals("@XmlType(name = \"sayHiResponse\", "
+                     + "namespace = \"" + expectedNamespace + "\")",
+                     xmlTypeAnnotation.toString());
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotatorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotatorTest.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotatorTest.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotatorTest.java Thu Jan  3 08:34:38 2008
@@ -20,7 +20,9 @@
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
 
-import org.apache.cxf.tools.common.model.JavaAnnotation;
+import java.util.List;
+
+import org.apache.cxf.tools.common.model.JAnnotation;
 import org.apache.cxf.tools.common.model.JavaClass;
 import org.apache.cxf.tools.common.model.JavaField;
 import org.junit.Assert;
@@ -38,15 +40,15 @@
                                            "http://doc.withannotation.fortest.tools.cxf.apache.org/");
 
         reqField.setOwner(clz);
-        JavaAnnotation annotation = reqField.getAnnotation();
-        assertNull(annotation);
+        List<JAnnotation> annotation = reqField.getAnnotations();
+        assertEquals(0, annotation.size());
         
         reqField.annotate(new WrapperBeanFieldAnnotator());
-        annotation = reqField.getAnnotation();
+        annotation = reqField.getAnnotations();
 
         String expectedNamespace = "http://doc.withannotation.fortest.tools.cxf.apache.org/";
-        assertEquals("@XmlElement(namespace = \"" + expectedNamespace + "\", name = \"array\")",
-                     annotation.toString());
+        assertEquals("@XmlElement(name = \"array\", namespace = \"" + expectedNamespace + "\")",
+                     annotation.get(0).toString());
 
         clz.setFullClassName("org.apache.cxf.tools.fortest.withannotation.doc.jaxws.SayHiResponse");
         JavaField resField = new JavaField("return",
@@ -54,8 +56,8 @@
                                            "http://doc.withannotation.fortest.tools.cxf.apache.org/");
         resField.setOwner(clz);
         resField.annotate(new WrapperBeanFieldAnnotator());
-        annotation = resField.getAnnotation();
-        assertEquals("@XmlElement(namespace = \"" + expectedNamespace + "\", name = \"return\")",
-                     annotation.toString());
+        annotation = resField.getAnnotations();
+        assertEquals("@XmlElement(name = \"return\", namespace = \"" + expectedNamespace + "\")",
+                     annotation.get(0).toString());
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,39 +19,44 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass;
 public class WrapperBeanAnnotator implements Annotator {
 
     public void annotate(final JavaAnnotatable clz) {
-        WrapperBeanClass wrapperBeanClass = null;
+        WrapperBeanClass beanClass = null;
         if (clz instanceof WrapperBeanClass) {
-            wrapperBeanClass = (WrapperBeanClass) clz;
+            beanClass = (WrapperBeanClass) clz;
         } else {
             throw new RuntimeException("WrapperBeanAnnotator expect JavaClass as input");
         }
 
-        JavaAnnotation xmlRootElement = new JavaAnnotation("XmlRootElement");
-        xmlRootElement.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlRootElement.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
-
-        JavaAnnotation xmlAccessorType = new JavaAnnotation("XmlAccessorType");
-        xmlAccessorType.addArgument("XmlAccessType.FIELD", "null", "");
+        JAnnotation xmlRootElement = new JAnnotation(XmlRootElement.class);
+        xmlRootElement.addElement(new JAnnotationElement("name", 
+                                                         beanClass.getElementName().getLocalPart()));
+        xmlRootElement.addElement(new JAnnotationElement("namespace", 
+                                                         beanClass.getElementName().getNamespaceURI()));
+        
+        JAnnotation xmlAccessorType = new JAnnotation(XmlAccessorType.class);
+        xmlAccessorType.addElement(new JAnnotationElement(null, XmlAccessType.FIELD));
 
-        JavaAnnotation xmlType = new JavaAnnotation("XmlType");
-        //xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("name", wrapperBeanClass.getElementName().getLocalPart());
-        xmlType.addArgument("namespace", wrapperBeanClass.getElementName().getNamespaceURI());
+        JAnnotation xmlType = new JAnnotation(XmlType.class);
+        xmlType.addElement(new JAnnotationElement("name", 
+                                                  beanClass.getElementName().getLocalPart()));
+        xmlType.addElement(new JAnnotationElement("namespace", 
+                                                  beanClass.getElementName().getNamespaceURI()));
+        
         // Revisit: why annotation is string?
-        wrapperBeanClass.addAnnotation(xmlRootElement.toString());
-        wrapperBeanClass.addAnnotation(xmlAccessorType.toString());
-        wrapperBeanClass.addAnnotation(xmlType.toString());
-
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlAccessorType");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlRootElement");
-        wrapperBeanClass.addImport("javax.xml.bind.annotation.XmlType");
+        beanClass.addAnnotation(xmlRootElement);
+        beanClass.addAnnotation(xmlAccessorType);
+        beanClass.addAnnotation(xmlType);
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/annotator/WrapperBeanFieldAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,9 +19,19 @@
 
 package org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator;
 
+import java.lang.annotation.Annotation;
+
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlList;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaField;
 
 public class WrapperBeanFieldAnnotator implements Annotator {
@@ -34,12 +44,32 @@
             throw new RuntimeException("WrapperBeanFiledAnnotator expect JavaField as input");
         }
         String rawName = jField.getRawName();
-        JavaAnnotation xmlElementAnnotation = new JavaAnnotation("XmlElement");
-        
-        xmlElementAnnotation.addArgument("name", rawName);
-        xmlElementAnnotation.addArgIgnoreEmpty("namespace", jField.getTargetNamespace(), "\"");
+        JAnnotation xmlElementAnnotation = new JAnnotation(XmlElement.class);
+        xmlElementAnnotation.addElement(new JAnnotationElement("name", rawName));
+        if (!StringUtils.isEmpty(jField.getTargetNamespace())) {
+            xmlElementAnnotation.addElement(new JAnnotationElement("namespace", 
+                                                                          jField.getTargetNamespace()));
+        }
 
-        jField.setAnnotation(xmlElementAnnotation);
-        jField.getOwner().addImport("javax.xml.bind.annotation.XmlElement");
+        jField.addAnnotation(xmlElementAnnotation);
+        
+        for (Annotation ann : jField.getJaxbAnnotaions()) {
+            if (ann instanceof XmlMimeType) {
+                JAnnotation mimeAnno = new JAnnotation(XmlMimeType.class);
+                mimeAnno.addElement(new JAnnotationElement("value", ((XmlMimeType)ann).value()));
+                jField.addAnnotation(mimeAnno);
+            } else if (ann instanceof XmlJavaTypeAdapter) {           
+                JAnnotation jaxbAnn = new JAnnotation(XmlJavaTypeAdapter.class);
+                jaxbAnn.addElement(new JAnnotationElement("value", ((XmlJavaTypeAdapter)ann).value()));
+                jaxbAnn.addElement(new JAnnotationElement("type", ((XmlJavaTypeAdapter)ann).type()));
+                jField.addAnnotation(jaxbAnn);
+            } else if (ann instanceof XmlAttachmentRef) {
+                JAnnotation jaxbAnn = new JAnnotation(XmlAttachmentRef.class);
+                jField.addAnnotation(jaxbAnn);
+            } else if (ann instanceof XmlList) {
+                JAnnotation jaxbAnn = new JAnnotation(XmlList.class);
+                jField.addAnnotation(jaxbAnn);
+            }
+        }
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java Thu Jan  3 08:34:38 2008
@@ -22,6 +22,8 @@
 import java.io.IOException;
 import java.io.Writer;
 
+import javax.jws.HandlerChain;
+
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
@@ -29,7 +31,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.common.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
 
@@ -37,13 +40,13 @@
 
     private static final String HANDLER_CHAIN_NAME = "";
     private JavaInterface intf;
-    private JavaAnnotation handlerChainAnnotation;
+    private JAnnotation handlerChainAnnotation;
 
     public HandlerConfigGenerator() {
         this.name = ToolConstants.HANDLER_GENERATOR;
     }
 
-    public JavaAnnotation getHandlerAnnotation() {
+    public JAnnotation getHandlerAnnotation() {
         return handlerChainAnnotation;
     }
 
@@ -73,9 +76,10 @@
                                                ToolConstants.HANDLER_CHAIN);
         if (nl.getLength() > 0) {
             String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
-            handlerChainAnnotation = new JavaAnnotation("HandlerChain");
-            handlerChainAnnotation.addArgument("name", HANDLER_CHAIN_NAME);
-            handlerChainAnnotation.addArgument("file", fName + ".xml");
+            handlerChainAnnotation = new JAnnotation(HandlerChain.class);
+            handlerChainAnnotation.addElement(new JAnnotationElement("name", 
+                                                                     HANDLER_CHAIN_NAME));
+            handlerChainAnnotation.addElement(new JAnnotationElement("file", fName + ".xml"));           
             generateHandlerChainFile(e, parseOutputName(this.intf.getPackageName(),
                                                         fName,
                                                         ".xml"));

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java Thu Jan  3 08:34:38 2008
@@ -28,6 +28,7 @@
 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.JAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.util.ClassCollector;
@@ -89,7 +90,7 @@
                 handlerGen.setJavaInterface(intf);
                 handlerGen.generate(getEnvironment());
 
-                String annot = handlerGen.getHandlerAnnotation().toString();
+                JAnnotation annot = handlerGen.getHandlerAnnotation();
                 if (handlerGen.getHandlerAnnotation() != null) {
                     boolean existHandlerAnno = false;
                     for (JAnnotation jann : intf.getAnnotations()) {

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java Thu Jan  3 08:34:38 2008
@@ -28,12 +28,13 @@
 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.JAnnotation;
 import org.apache.cxf.tools.common.model.JavaModel;
+import org.apache.cxf.tools.common.model.JavaPort;
 import org.apache.cxf.tools.common.model.JavaServiceClass;
 import org.apache.cxf.tools.util.ClassCollector;
 
 public class ServiceGenerator extends AbstractJAXWSGenerator {
-    //private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
     private static final String SERVICE_TEMPLATE = TEMPLATE_BASE + "/service.vm";
 
     public ServiceGenerator() {
@@ -83,7 +84,7 @@
                 handlerGen.setJavaInterface(js);
                 handlerGen.generate(getEnvironment());
 
-                String annot = handlerGen.getHandlerAnnotation().toString();
+                JAnnotation annot = handlerGen.getHandlerAnnotation();
                                
                 if (handlerGen.getHandlerAnnotation() != null) {
                     boolean existHandlerAnno = false;
@@ -96,12 +97,16 @@
                         js.addAnnotation(annot);
                         js.addImport("javax.jws.HandlerChain");
                     }
-                    js.addImport("javax.jws.HandlerChain");
                 }
                 
             }
 
-            
+            for (JavaPort port : js.getPorts()) {
+                if (!port.getPackageName().equals(js.getPackageName())) {
+                    js.addImport(port.getFullClassName());
+                }
+            }
+
             String url = (String)env.get(ToolConstants.CFG_WSDLURL);
             String location = (String)env.get(ToolConstants.CFG_WSDLLOCATION);
             if (location == null 

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java Thu Jan  3 08:34:38 2008
@@ -24,6 +24,8 @@
 import java.util.List;
 import java.util.logging.Level;
 
+import javax.jws.WebParam;
+
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -31,7 +33,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.common.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
@@ -59,6 +62,7 @@
         Collection<FaultInfo> faults = operation.getFaults();
         FaultProcessor faultProcessor = new FaultProcessor(context);
         faultProcessor.process(method, faults);
+
         intf.addMethod(method);
     }
 
@@ -93,7 +97,7 @@
         }
 
         method.annotate(new WebResultAnnotator());
-        method.annotate(new SoapBindingAnnotator());
+        method.annotate(new SoapBindingAnnotator());                
 
         JAXWSBinding opBinding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);
 
@@ -187,16 +191,18 @@
         }
 
         JavaParameter asyncHandler = new JavaParameter();
+        
         asyncHandler.setName("asyncHandler");
         asyncHandler.setCallback(true);
         asyncHandler.setClassName(getAsyncClassName(method, "AsyncHandler"));
-        JavaAnnotation asyncHandlerAnnotation = new JavaAnnotation("WebParam");
-        asyncHandlerAnnotation.addArgument("name", "asyncHandler");
-        asyncHandlerAnnotation.addArgument("targetNamespace", "");
-        asyncHandler.setAnnotation(asyncHandlerAnnotation);
         asyncHandler.setStyle(JavaType.Style.IN);
-
+        
         callbackMethod.addParameter(asyncHandler);
+        
+        JAnnotation asyncHandlerAnnotation = new JAnnotation(WebParam.class);
+        asyncHandlerAnnotation.addElement(new JAnnotationElement("name", "asyncHandler"));
+        asyncHandlerAnnotation.addElement(new JAnnotationElement("targetNamespace", ""));
+        asyncHandler.setAnnotation(asyncHandlerAnnotation);                
 
         method.getInterface().addMethod(callbackMethod);
     }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/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/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java Thu Jan  3 08:34:38 2008
@@ -25,6 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.http.HTTPBinding;
 import javax.wsdl.extensions.mime.MIMEContent;
@@ -52,7 +53,8 @@
 import org.apache.cxf.tools.common.extensions.soap.SoapBody;
 import org.apache.cxf.tools.common.extensions.soap.SoapHeader;
 import org.apache.cxf.tools.common.extensions.soap.SoapOperation;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaModel;
@@ -377,9 +379,9 @@
                 }
 
                 if (headerType == this.resultHeader) {
-                    JavaAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
+                    JAnnotation resultAnno = jm.getAnnotationMap().get("WebResult");
                     if (resultAnno != null) {
-                        resultAnno.addArgument("header", "true", "");
+                        resultAnno.addElement(new JAnnotationElement("header", true, true));
                     }
                 }
                 processParameter(jm, bop);
@@ -389,9 +391,12 @@
 
     private void setParameterAsHeader(JavaParameter parameter) {
         parameter.setHeader(true);
-        parameter.getAnnotation().addArgument("header", "true", "");
-        parameter.getAnnotation().addArgument("name", parameter.getQName().getLocalPart());
-        parameter.getAnnotation().addArgument("targetNamespace", parameter.getTargetNamespace());
+        JAnnotation parameterAnnotation = parameter.getAnnotation();
+        parameterAnnotation.addElement(new JAnnotationElement("header", true, true));
+        parameterAnnotation.addElement(new JAnnotationElement("name", 
+                                                                     parameter.getQName().getLocalPart()));
+        parameterAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                     parameter.getTargetNamespace()));
     }
 
     private void processParameter(JavaMethod jm, BindingOperationInfo operation) throws ToolException {

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/BindingAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,15 +19,14 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
-import java.util.*;
 import javax.jws.soap.SOAPBinding;
 
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
 
 public final class BindingAnnotator implements Annotator {
     
@@ -40,22 +39,18 @@
         }
         
         if (processBinding(intf)) {
-            JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
+            JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
             if (!SOAPBinding.Style.DOCUMENT.equals(intf.getSOAPStyle())) {
-                String style = SOAPBindingUtil.getBindingAnnotation(intf.getSOAPStyle().toString());
-                bindingAnnotation.addArgument("style", style, "");                
+                bindingAnnotation.addElement(new JAnnotationElement("style", intf.getSOAPStyle()));
             }
             if (!SOAPBinding.Use.LITERAL.equals(intf.getSOAPUse())) {
-                String use = SOAPBindingUtil.getBindingAnnotation(intf.getSOAPUse().toString());
-                bindingAnnotation.addArgument("use", use, "");
+                bindingAnnotation.addElement(new JAnnotationElement("use", intf.getSOAPUse()));
             }            
             if (intf.getSOAPStyle() == SOAPBinding.Style.DOCUMENT) {
-                String parameterStyle = SOAPBindingUtil.getBindingAnnotation(intf.
-                                                                             getSOAPParameterStyle().
-                                                                             toString());
-                bindingAnnotation.addArgument("parameterStyle", parameterStyle, "");
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                           intf.getSOAPParameterStyle()));
             }
-            intf.addAnnotation(bindingAnnotation.toString());
+            intf.addAnnotation(bindingAnnotation);
         }
     }
     

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/SoapBindingAnnotator.java Thu Jan  3 08:34:38 2008
@@ -20,11 +20,12 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
 import javax.jws.soap.SOAPBinding;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
-import org.apache.cxf.tools.util.SOAPBindingUtil;
 
 public class SoapBindingAnnotator implements Annotator {
 
@@ -39,15 +40,15 @@
             if (!method.isWrapperStyle()
                 && !SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
             
-                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
-                bindingAnnotation.addArgument("parameterStyle",
-                                              SOAPBindingUtil.getBindingAnnotation("BARE"), "");
+                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                           SOAPBinding.ParameterStyle.BARE));
                 method.addAnnotation("SOAPBinding", bindingAnnotation);
             } else if (method.isWrapperStyle()
                 && SOAPBinding.ParameterStyle.BARE.equals(method.getInterface().getSOAPParameterStyle())) {
-                JavaAnnotation bindingAnnotation = new JavaAnnotation("SOAPBinding");
-                bindingAnnotation.addArgument("parameterStyle",
-                                              SOAPBindingUtil.getBindingAnnotation("WRAPPED"), "");
+                JAnnotation bindingAnnotation = new JAnnotation(SOAPBinding.class);
+                bindingAnnotation.addElement(new JAnnotationElement("parameterStyle", 
+                                                                        SOAPBinding.ParameterStyle.WRAPPED));
                 method.addAnnotation("SOAPBinding", bindingAnnotation);                
             }
         }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebMethodAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,10 +19,13 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebMethod;
+
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 
 public class WebMethodAnnotator implements Annotator {
@@ -35,15 +38,14 @@
             throw new RuntimeException("WebMethod can only annotate JavaMethod");
         }
         String operationName = method.getOperationName();
-        JavaAnnotation methodAnnotation = new JavaAnnotation("WebMethod");
+        JAnnotation methodAnnotation = new JAnnotation(WebMethod.class);
         
         if (!method.getName().equals(operationName)) {
-            methodAnnotation.addArgument("operationName", operationName);
+            methodAnnotation.addElement(new JAnnotationElement("operationName", operationName));
         }
         if (!StringUtils.isEmpty(method.getSoapAction())) {
-            methodAnnotation.addArgument("action", method.getSoapAction());
+            methodAnnotation.addElement(new JAnnotationElement("action", method.getSoapAction()));
         }
         method.addAnnotation("WebMethod", methodAnnotation);
-        method.getInterface().addImport("javax.jws.WebMethod");
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,11 +19,13 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebParam;
 import javax.jws.soap.SOAPBinding;
 
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 import org.apache.cxf.tools.common.model.JavaType;
@@ -45,7 +47,7 @@
             }
         }
 
-        JavaAnnotation webParamAnnotation = new JavaAnnotation("WebParam");
+        JAnnotation webParamAnnotation = new JAnnotation(WebParam.class);
         String name = parameter.getName();
         String targetNamespace = method.getInterface().getNamespace();
         String partName = null;
@@ -68,14 +70,18 @@
         }
 
         if (partName != null) {
-            webParamAnnotation.addArgument("partName", partName);
+            webParamAnnotation.addElement(new JAnnotationElement("partName", partName));
         }
-        if (parameter.getStyle() == JavaType.Style.OUT || parameter.getStyle() == JavaType.Style.INOUT) {
-            webParamAnnotation.addArgument("mode", "Mode." + parameter.getStyle().toString(), "");
-        }
-        webParamAnnotation.addArgument("name", name);
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader()) {
-            webParamAnnotation.addArgIgnoreEmpty("targetNamespace", targetNamespace, "\"");
+        if (parameter.getStyle() == JavaType.Style.OUT) {
+            webParamAnnotation.addElement(new JAnnotationElement("mode", WebParam.Mode.OUT));
+        } else if (parameter.getStyle() == JavaType.Style.INOUT) {
+            webParamAnnotation.addElement(new JAnnotationElement("mode", WebParam.Mode.INOUT));
+        }
+        webParamAnnotation.addElement(new JAnnotationElement("name", name));
+        if (null != targetNamespace 
+                && (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader())) {        
+            webParamAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                        targetNamespace));        
         }
 
         parameter.setAnnotation(webParamAnnotation);

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebResultAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,10 +19,14 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.Oneway;
+import javax.jws.WebResult;
 import javax.jws.soap.SOAPBinding;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 
 public class WebResultAnnotator implements Annotator {
@@ -36,16 +40,15 @@
         }
             
         if (method.isOneWay()) {
-            JavaAnnotation oneWayAnnotation = new JavaAnnotation("Oneway");
+            JAnnotation oneWayAnnotation = new JAnnotation(Oneway.class);
             method.addAnnotation("Oneway", oneWayAnnotation);
-            method.getInterface().addImport("javax.jws.Oneway");
             return;
         }
 
         if ("void".equals(method.getReturn().getType())) {
             return;
         }
-        JavaAnnotation resultAnnotation = new JavaAnnotation("WebResult");
+        JAnnotation resultAnnotation = new JAnnotation(WebResult.class);
         String targetNamespace = method.getReturn().getTargetNamespace();
         String name = "return";
 
@@ -66,13 +69,15 @@
         }
 
         
-        
-        resultAnnotation.addArgument("name", name);
-        resultAnnotation.addArgIgnoreEmpty("targetNamespace", targetNamespace, "\"");
+        resultAnnotation.addElement(new JAnnotationElement("name", name));
+        if (null != targetNamespace) {
+            resultAnnotation.addElement(new JAnnotationElement("targetNamespace", targetNamespace));
+        }
 
         if (method.getSoapStyle() == SOAPBinding.Style.RPC
             || (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT && !method.isWrapperStyle())) {
-            resultAnnotation.addArgument("partName", method.getReturn().getName());
+            resultAnnotation.addElement(new JAnnotationElement("partName", 
+                                                                      method.getReturn().getName()));
         }
 
         method.addAnnotation("WebResult", resultAnnotation);

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebServiceAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,9 +19,12 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import javax.jws.WebService;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaInterface;
 
 public final class WebServiceAnnotator implements Annotator {
@@ -33,12 +36,12 @@
         } else {
             throw new RuntimeException("WebService can only annotate JavaInterface");
         }
-        JavaAnnotation serviceAnnotation = new JavaAnnotation("WebService");
-        serviceAnnotation.addArgument("targetNamespace", intf.getNamespace());
-        //serviceAnnotation.addArgument("wsdlLocation", intf.getLocation());
-        serviceAnnotation.addArgument("name", intf.getWebServiceName());
+        JAnnotation serviceAnnotation = new JAnnotation(WebService.class);
+        serviceAnnotation.addElement(new JAnnotationElement("targetNamespace", 
+                                                                   intf.getNamespace()));
+        serviceAnnotation.addElement(new JAnnotationElement("name", intf.getWebServiceName()));
         
-        intf.addAnnotation(serviceAnnotation.toString());
+        intf.addAnnotation(serviceAnnotation);
     }
 }
 

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WrapperAnnotator.java Thu Jan  3 08:34:38 2008
@@ -19,9 +19,16 @@
 
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
 import org.apache.cxf.tools.common.model.Annotator;
+import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaAnnotatable;
-import org.apache.cxf.tools.common.model.JavaAnnotation;
 import org.apache.cxf.tools.common.model.JavaMethod;
 import org.apache.cxf.tools.common.model.JavaParameter;
 
@@ -42,20 +49,27 @@
             throw new RuntimeException("RequestWrapper and ResponseWrapper can only annotate JavaMethod");
         }
         if (wrapperRequest != null) {
-            JavaAnnotation wrapperRequestAnnotation = new JavaAnnotation("RequestWrapper");
-            wrapperRequestAnnotation.addArgument("localName", wrapperRequest.getType());
-            wrapperRequestAnnotation.addArgument("targetNamespace", wrapperRequest.getTargetNamespace());
-            wrapperRequestAnnotation.addArgument("className", wrapperRequest.getClassName());
-            method.addAnnotation("RequestWrapper", wrapperRequestAnnotation);
-            method.getInterface().addImport("javax.xml.ws.RequestWrapper");
+            JAnnotation requestAnnotation = new JAnnotation(RequestWrapper.class);
+            requestAnnotation.addElement(new JAnnotationElement("localName",
+                                                                       wrapperRequest.getType()));
+            requestAnnotation.addElement(new JAnnotationElement("targetNamespace",
+                                                                       wrapperRequest.getTargetNamespace()));
+            requestAnnotation.addElement(new JAnnotationElement("className", 
+                                                                       wrapperRequest.getClassName()));
+
+            method.addAnnotation("RequestWrapper", requestAnnotation);
+            method.getInterface().addImports(requestAnnotation.getImports());
         }
         if (wrapperResponse != null) {
-            JavaAnnotation wrapperResponseAnnotation = new JavaAnnotation("ResponseWrapper");
-            wrapperResponseAnnotation.addArgument("localName", wrapperResponse.getType());
-            wrapperResponseAnnotation.addArgument("targetNamespace", wrapperResponse.getTargetNamespace());
-            wrapperResponseAnnotation.addArgument("className", wrapperResponse.getClassName());
-            method.addAnnotation("ResponseWrapper", wrapperResponseAnnotation);
-            method.getInterface().addImport("javax.xml.ws.ResponseWrapper");
+            List<JAnnotationElement> elements = new ArrayList<JAnnotationElement>();
+            elements.add(new JAnnotationElement("localName", wrapperResponse.getType()));
+            elements.add(new JAnnotationElement("targetNamespace", wrapperResponse.getTargetNamespace()));
+            elements.add(new JAnnotationElement("className", wrapperResponse.getClassName()));
+
+            JAnnotation responseAnnotation = new JAnnotation(ResponseWrapper.class);
+            responseAnnotation.getElements().addAll(elements);
+            method.addAnnotation("ResponseWrapper", responseAnnotation);
+            method.getInterface().addImports(responseAnnotation.getImports());
         }
     }
 }

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm?rev=608552&r1=608551&r2=608552&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/template/sei.vm Thu Jan  3 08:34:38 2008
@@ -17,11 +17,6 @@
 
 package $intf.PackageName;
 
-import javax.jws.WebParam.Mode;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding.Style;
-import javax.jws.soap.SOAPBinding;
 #foreach ($import in $intf.Imports)
 import ${import};
 #end



Mime
View raw message