maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r710186 - /maven/sandbox/trunk/plugins/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/AbstractJavasrcMojo.java
Date Mon, 03 Nov 2008 22:07:30 GMT
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 );



Mime
View raw message