cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5479] Support for more WADLGenerator parameters
Date Tue, 20 May 2014 21:39:51 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ec8856a65 -> 4d25dac91


[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/4d25dac9
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4d25dac9
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4d25dac9

Branch: refs/heads/2.7.x-fixes
Commit: 4d25dac911bb6a0e20838a2c134efc37217d7c8f
Parents: ec8856a
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:39:29 2014 +0100

----------------------------------------------------------------------
 .../maven_plugin/javatowadl/Java2WADLMojo.java  | 57 +++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4d25dac9/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 1071c70..fe8679f 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
@@ -116,16 +116,71 @@ 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());
+        setExtraProperties(wadlGenerator);
         StringBuilder sbMain = wadlGenernator.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