You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2009/06/21 14:54:42 UTC

svn commit: r787005 - in /maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf: DateBean.java DocumentDescriptorReader.java DocumentModelBuilder.java PdfMojo.java

Author: ltheussl
Date: Sun Jun 21 12:54:41 2009
New Revision: 787005

URL: http://svn.apache.org/viewvc?rev=787005&view=rev
Log:
Checkstyle fixes

Modified:
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DateBean.java
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentDescriptorReader.java
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java
    maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DateBean.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DateBean.java?rev=787005&r1=787004&r2=787005&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DateBean.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DateBean.java Sun Jun 21 12:54:41 2009
@@ -96,7 +96,7 @@
 
 
     /**
-     * @return the current year.
+     * @return the year in format "yyyy".
      */
     public String getYear()
     {
@@ -107,7 +107,7 @@
     }
 
     /**
-     * @return the current month.
+     * @return the month in format "MM".
      */
     public String getMonth()
     {
@@ -118,7 +118,7 @@
     }
 
     /**
-     * @return the current day.
+     * @return the day in format "dd".
      */
     public String getDay()
     {
@@ -129,7 +129,7 @@
     }
 
     /**
-     * @return the current hour.
+     * @return the hour in format "HH".
      */
     public String getHour()
     {
@@ -140,7 +140,7 @@
     }
 
     /**
-     * @return the current minute.
+     * @return the minute in format "mm".
      */
     public String getMinute()
     {
@@ -151,7 +151,7 @@
     }
 
     /**
-     * @return the current second.
+     * @return the second in format "ss".
      */
     public String getSecond()
     {
@@ -162,7 +162,7 @@
     }
 
     /**
-     * @return the current millisecond.
+     * @return the millisecond in format "SSS".
      */
     public String getMillisecond()
     {
@@ -173,7 +173,7 @@
     }
 
     /**
-     * @return the current date using the ISO 8601 format, i.e. <code>yyyy-MM-dd</code>.
+     * @return the date using the ISO 8601 format, i.e. <code>yyyy-MM-dd</code>.
      */
     public String getDate()
     {
@@ -184,7 +184,7 @@
     }
 
     /**
-     * @return the current time using the ISO 8601 format and UTC time zone, i.e. <code>HH:mm:ss'Z'</code>.
+     * @return the time using the ISO 8601 format and UTC time zone, i.e. <code>HH:mm:ss'Z'</code>.
      */
     public String getTime()
     {
@@ -195,7 +195,7 @@
     }
 
     /**
-     * @return the current datetime using the ISO 8601 format, i.e. <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code>.
+     * @return the datetime using the ISO 8601 format, i.e. <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code>.
      */
     public String getDateTime()
     {

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentDescriptorReader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentDescriptorReader.java?rev=787005&r1=787004&r2=787005&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentDescriptorReader.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentDescriptorReader.java Sun Jun 21 12:54:41 2009
@@ -51,7 +51,10 @@
  */
 public class DocumentDescriptorReader
 {
+    /** A MavenProject to extract additional info. */
     private final MavenProject project;
+
+    /** Used to log the interpolated document descriptor. */
     private final Log log;
 
     /**

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java?rev=787005&r1=787004&r2=787005&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/DocumentModelBuilder.java Sun Jun 21 12:54:41 2009
@@ -47,7 +47,10 @@
  */
 public class DocumentModelBuilder
 {
+    /** A MavenProject to extract the information. */
     private final MavenProject project;
+
+    /** A DecorationModel to extract additional information. */
     private final DecorationModel decorationModel;
 
     /**

Modified: maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java?rev=787005&r1=787004&r2=787005&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java (original)
+++ maven/plugins/trunk/maven-pdf-plugin/src/main/java/org/apache/maven/plugins/pdf/PdfMojo.java Sun Jun 21 12:54:41 2009
@@ -238,7 +238,7 @@
             {
                 final Locale locale = (Locale) iterator.next();
 
-                final File workingDir = getWorkingDirectory( locale, defaultLocale );
+                final File workingDir = getWorkingDirectory( locale );
 
                 File siteDirectoryFile = siteDirectory;
                 if ( !locale.getLanguage().equals( defaultLocale.getLanguage() ) )
@@ -295,8 +295,6 @@
      *
      * @param locale not null
      * @return DocumentModel.
-     * @throws DocumentRendererException if any.
-     * @throws IOException if any.
      * @throws MojoExecutionException if any
      * @see #readAndFilterDocumentDescriptor(MavenProject, File, Log)
      */
@@ -318,11 +316,18 @@
         model.getCover().setCoverType( i18n.getString( "pdf-plugin", defaultLocale, "toc.type" ) );
         model.getToc().setName( i18n.getString( "pdf-plugin", defaultLocale, "toc.title" ) );
 
-        debugLogGeneratedModel( project, model );
+        debugLogGeneratedModel( model );
 
         return model;
     }
 
+    /**
+     * Read a DocumentModel from a file.
+     *
+     * @param locale used to set the language.
+     * @return the DocumentModel read from the configured document descriptor.
+     * @throws org.apache.maven.plugin.MojoExecutionException if the model could not be read.
+     */
     private DocumentModel getDocumentModelFromDescriptor( Locale locale )
             throws MojoExecutionException
     {
@@ -358,10 +363,9 @@
      * Return the working directory for a given Locale and the current default Locale.
      *
      * @param locale a Locale.
-     * @param defaultLocale the current default Locale.
      * @return File.
      */
-    private File getWorkingDirectory( Locale locale, Locale defaultLocale )
+    private File getWorkingDirectory( Locale locale )
     {
         if ( locale.getLanguage().equals( defaultLocale.getLanguage() ) )
         {
@@ -504,8 +508,6 @@
     /**
      * Construct a default producer.
      *
-     * @param version the current plugin version. May be null.
-     * @param implementation the pdf implementation. May be null.
      * @return A String in the form <code>Maven PDF Plugin v. 1.1.1, 'fo' implementation</code>.
      */
     private String getDefaultGenerator()
@@ -513,7 +515,12 @@
         return "Maven PDF Plugin v. " + pluginVersion + ", '" + implementation + "' implementation.";
     }
 
-    private void debugLogGeneratedModel( MavenProject project, final DocumentModel docModel )
+    /**
+     * Write the auto-generated model to disc.
+     *
+     * @param docModel the model to write.
+     */
+    private void debugLogGeneratedModel( final DocumentModel docModel )
     {
         if ( getLog().isDebugEnabled() && project != null )
         {