cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] git commit: [CXF-5479] Support for more WADLGenerator parameters
Date Tue, 20 May 2014 21:35:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0024d9455 -> 6b4598644


[CXF-5479] Support for more WADLGenerator parameters


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b15aa32f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b15aa32f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b15aa32f

Branch: refs/heads/master
Commit: b15aa32fbf449e4c402b262b8c215fbb950314d6
Parents: 5036637
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue May 20 22:33:58 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue May 20 22:33:58 2014 +0100

----------------------------------------------------------------------
 .../maven_plugin/javatowadl/Java2WADLMojo.java  | 65 ++++++++++++++++++--
 1 file changed, 60 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b15aa32f/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
index 1cda24d..985525f 100644
--- a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
+++ b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
@@ -121,29 +121,84 @@ public class Java2WADLMojo extends AbstractMojo {
      */
     private boolean useJson;
 
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean singleResourceMultipleMethods;
    
-      
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean useSingleSlashResource;
+    
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean ignoreForwardSlash;
+    
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean addResourceAndMethodIds;
+    
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean linkJsonToXmlSchema;
+    
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean checkAbsolutePathSlash;
+    
+    /**
+     * @parameter
+     */
+    private String applicationTitle;
+    
+    /**
+     * @parameter
+     */
+    private String namespacePrefix;
+    
     public void execute() throws MojoExecutionException {
         
         getResourcesList();
-        WadlGenerator wadlGenernator = new WadlGenerator(getBus());
+        WadlGenerator wadlGenerator = new WadlGenerator(getBus());
         DocumentationProvider documentationProvider = null;
         if (docProvider != null) {
             try {
                 documentationProvider = (DocumentationProvider)getClassLoader().loadClass(docProvider).
                     getConstructor(new Class[] {String.class}).
                     newInstance(new Object[] {project.getBuild().getDirectory()});
-                wadlGenernator.setDocumentationProvider(documentationProvider);
+                wadlGenerator.setDocumentationProvider(documentationProvider);
             } catch (Exception e) {
                 throw new MojoExecutionException(e.getMessage(), e);
             }
         }
-            
-        StringBuilder sbMain = wadlGenernator.generateWADL(getBaseURI(), classResourceInfos,
useJson, null, null);
+        setExtraProperties(wadlGenerator);
+        
+        StringBuilder sbMain = wadlGenerator.generateWADL(getBaseURI(), classResourceInfos,
useJson, null, null);
         getLog().debug("the wadl is =====> \n" + sbMain.toString());
         generateWadl(sbMain.toString());
     }
     
+    private void setExtraProperties(WadlGenerator wg) {
+        wg.setSingleResourceMultipleMethods(singleResourceMultipleMethods);
+        wg.setUseSingleSlashResource(useSingleSlashResource);
+        wg.setIgnoreForwardSlash(ignoreForwardSlash);
+        wg.setAddResourceAndMethodIds(addResourceAndMethodIds);
+        wg.setLinkJsonToXmlSchema(linkJsonToXmlSchema);
+        wg.setCheckAbsolutePathSlash(checkAbsolutePathSlash);
+         
+        if (applicationTitle != null) {
+            wg.setApplicationTitle(applicationTitle);
+        } 
+        if (namespacePrefix != null) {
+            wg.setNamespacePrefix(namespacePrefix);
+        }
+    }
+    
     private void generateWadl(String wadl) throws MojoExecutionException {
      
         if (outputFile == null && project != null) {


Mime
View raw message