You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2008/11/03 23:07:30 UTC

svn commit: r710186 - /maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java

Author: hboutemy
Date: Mon Nov  3 14:07:29 2008
New Revision: 710186

URL: http://svn.apache.org/viewvc?rev=710186&view=rev
Log:
[JXR-67] use ${project.reporting.outputEncoding} as default value for "outputEncoding" parameter and default to UTF-8

Modified:
    maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java

Modified: maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java?rev=710186&r1=710185&r2=710186&view=diff
==============================================================================
--- maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java (original)
+++ maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java Mon Nov  3 14:07:29 2008
@@ -81,9 +81,10 @@
     private String bottom;
 
     /**
-     * Specifies the encoding of the generated HTML files.
+     * Specifies the encoding of the generated HTML files. If not specificed, the docencoding value will be
+     * <code>UTF-8</code>.
      *
-     * @parameter expression="${docencoding}" default-value="ISO-8859-1"
+     * @parameter expression="${docencoding}" default-value="${project.reporting.outputEncoding}"
      */
     private String docencoding;
 
@@ -158,6 +159,14 @@
     private String windowTitle;
 
     /**
+     * @return the docencoding attribute or <code>UTF-8</code> if <code>null</code>.
+     */
+    private String getDocencoding()
+    {
+        return ( StringUtils.isEmpty( docencoding ) ) ? ReaderFactory.UTF_8 : docencoding;
+    }
+
+    /**
      * Execute the <code>JavaSrc</code>.
      *
      * @throws IOException if any
@@ -172,10 +181,7 @@
         {
             options.setBottom( getBottomText() );
         }
-        if ( StringUtils.isNotEmpty( this.docencoding ) )
-        {
-            options.setDocencoding( this.docencoding );
-        }
+        options.setDocencoding( getDocencoding() );
         if ( StringUtils.isNotEmpty( this.doctitle ) )
         {
             options.setDoctitle( this.doctitle );