maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1074962 - in /maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer: DefaultSiteRenderer.java ModuleReference.java Renderer.java SiteRenderingContext.java
Date Sat, 26 Feb 2011 23:38:01 GMT
Author: hboutemy
Date: Sat Feb 26 23:38:00 2011
New Revision: 1074962

URL: http://svn.apache.org/viewvc?rev=1074962&view=rev
Log:
o improved javadoc
o added generics types as comments

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=1074962&r1=1074961&r2=1074962&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Sat Feb 26 23:38:00 2011
@@ -127,10 +127,9 @@ public class DefaultSiteRenderer
     // ----------------------------------------------------------------------
 
     /** {@inheritDoc} */
-    public void render( Collection documents,
-                        SiteRenderingContext siteRenderingContext,
+    public void render( Collection/*DocumentRenderer*/ documents, SiteRenderingContext siteRenderingContext,
                         File outputDirectory )
-            throws RendererException, IOException
+        throws RendererException, IOException
     {
         renderModule( documents, siteRenderingContext, outputDirectory );
 
@@ -142,11 +141,11 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public Map locateDocumentFiles( SiteRenderingContext siteRenderingContext )
+    public Map/*String, DocumentRenderer*/ locateDocumentFiles( SiteRenderingContext siteRenderingContext
)
             throws IOException, RendererException
     {
-        Map files = new LinkedHashMap();
-        Map moduleExcludes = siteRenderingContext.getModuleExcludes();
+        Map/*String, DocumentRenderer*/ files = new LinkedHashMap/*String, DocumentRenderer*/();
+        Map/*String, String*/ moduleExcludes = siteRenderingContext.getModuleExcludes();
 
         for ( Iterator i = siteRenderingContext.getSiteDirectories().iterator(); i.hasNext();
)
         {
@@ -197,10 +196,8 @@ public class DefaultSiteRenderer
         return files;
     }
 
-    private void addModuleFiles( File moduleBasedir,
-                                 SiteModule module,
-                                 String excludes,
-                                 Map files )
+    private void addModuleFiles( File moduleBasedir, SiteModule module, String excludes,
+                                 Map/*String, DocumentRenderer*/ files )
             throws IOException, RendererException
     {
         if ( moduleBasedir.exists() )
@@ -268,7 +265,7 @@ public class DefaultSiteRenderer
                     Map.Entry entry = (Map.Entry) iter.next();
                     if ( entry.getKey().toString().equalsIgnoreCase( key ) )
                     {
-                        DocumentRenderer renderer = (DocumentRenderer) files.get( entry.getKey()
);
+                        DocumentRenderer renderer = (DocumentRenderer) entry.getValue();
 
                         RenderingContext originalContext = renderer.getRenderingContext();
 
@@ -294,8 +291,7 @@ public class DefaultSiteRenderer
         }
     }
 
-    private void renderModule( Collection docs,
-                               SiteRenderingContext siteRenderingContext,
+    private void renderModule( Collection/*DocumentRenderer*/ docs, SiteRenderingContext
siteRenderingContext,
                                File outputDirectory )
             throws IOException, RendererException
     {
@@ -346,9 +342,7 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public void renderDocument( Writer writer,
-                                RenderingContext renderingContext,
-                                SiteRenderingContext context )
+    public void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext
context )
             throws RendererException, FileNotFoundException, UnsupportedEncodingException
     {
         SiteRendererSink sink = new SiteRendererSink( renderingContext );
@@ -439,8 +433,7 @@ public class DefaultSiteRenderer
         generateDocument( writer, sink, context );
     }
 
-    private Context createContext( SiteRendererSink sink,
-                                   SiteRenderingContext siteRenderingContext )
+    private Context createContext( SiteRendererSink sink, SiteRenderingContext siteRenderingContext
)
     {
         VelocityContext context = new VelocityContext();
 
@@ -520,9 +513,7 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public void generateDocument( Writer writer,
-                                  SiteRendererSink sink,
-                                  SiteRenderingContext siteRenderingContext )
+    public void generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext
siteRenderingContext )
             throws RendererException
     {
         Context context = createContext( sink, siteRenderingContext );
@@ -530,9 +521,7 @@ public class DefaultSiteRenderer
         writeTemplate( writer, context, siteRenderingContext );
     }
 
-    private void writeTemplate( Writer writer,
-                                Context context,
-                                SiteRenderingContext siteContext )
+    private void writeTemplate( Writer writer, Context context, SiteRenderingContext siteContext
)
             throws RendererException
     {
         ClassLoader old = null;
@@ -566,9 +555,7 @@ public class DefaultSiteRenderer
     /**
      * @noinspection OverlyBroadCatchBlock,UnusedCatchParameter
      */
-    private void processTemplate( String templateName,
-                                  Context context,
-                                  Writer writer )
+    private void processTemplate( String templateName, Context context, Writer writer )
             throws RendererException
     {
         Template template;
@@ -593,11 +580,8 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public SiteRenderingContext createContextForSkin( File skinFile,
-                                                      Map attributes,
-                                                      DecorationModel decoration,
-                                                      String defaultWindowTitle,
-                                                      Locale locale )
+    public SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel
decoration,
+                                                      String defaultWindowTitle, Locale locale
)
             throws IOException
     {
         SiteRenderingContext context = new SiteRenderingContext();
@@ -633,11 +617,8 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public SiteRenderingContext createContextForTemplate( File templateFile,
-                                                          File skinFile,
-                                                          Map attributes,
-                                                          DecorationModel decoration,
-                                                          String defaultWindowTitle,
+    public SiteRenderingContext createContextForTemplate( File templateFile, File skinFile,
Map attributes,
+                                                          DecorationModel decoration, String
defaultWindowTitle,
                                                           Locale locale )
             throws MalformedURLException
     {
@@ -669,9 +650,7 @@ public class DefaultSiteRenderer
     }
 
     /** {@inheritDoc} */
-    public void copyResources( SiteRenderingContext siteRenderingContext,
-                               File resourcesDirectory,
-                               File outputDirectory  )
+    public void copyResources( SiteRenderingContext siteRenderingContext, File resourcesDirectory,
File outputDirectory )
             throws IOException
     {
         if ( siteRenderingContext.getSkinJarFile() != null )
@@ -800,9 +779,7 @@ public class DefaultSiteRenderer
         }
     }
 
-    private void copyFileFromZip( ZipFile file,
-                                  ZipEntry entry,
-                                  File destFile )
+    private void copyFileFromZip( ZipFile file, ZipEntry entry, File destFile )
             throws IOException
     {
         FileOutputStream fos = new FileOutputStream( destFile );
@@ -824,8 +801,7 @@ public class DefaultSiteRenderer
      * @param destination destination file
      * @throws java.io.IOException if any
      */
-    protected void copyDirectory( File source,
-                                  File destination )
+    protected void copyDirectory( File source, File destination )
             throws IOException
     {
         if ( source.exists() )

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.java?rev=1074962&r1=1074961&r2=1074962&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/ModuleReference.java
Sat Feb 26 23:38:00 2011
@@ -51,7 +51,7 @@ class ModuleReference
     /**
      * <p>Getter for the field <code>basedir</code>.</p>
      *
-     * @return a {@link java.io.File} object.
+     * @return The base directory for module's source files.
      */
     public File getBasedir()
     {

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java?rev=1074962&r1=1074961&r2=1074962&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
Sat Feb 26 23:38:00 2011
@@ -55,7 +55,8 @@ public interface Renderer
      * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
      * @throws java.io.IOException if it bombs.
      */
-    void render( Collection documents, SiteRenderingContext siteRenderingContext, File outputDirectory
)
+    void render( Collection/*DocumentRenderer*/ documents, SiteRenderingContext siteRenderingContext,
+                 File outputDirectory )
         throws RendererException, IOException;
 
     /**
@@ -120,18 +121,18 @@ public interface Renderer
      * @throws java.io.IOException if it bombs.
      * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
      */
-    Map locateDocumentFiles( SiteRenderingContext siteRenderingContext )
+    Map/*String, DocumentRenderer*/ locateDocumentFiles( SiteRenderingContext siteRenderingContext
)
         throws IOException, RendererException;
 
     /**
      * Render a document.
      *
-     * @param writer
-     * @param renderingContext
-     * @param context
-     * @throws org.apache.maven.doxia.siterenderer.RendererException if it bombs.
-     * @throws java.io.FileNotFoundException if it bombs.
-     * @throws java.io.UnsupportedEncodingException if it bombs.
+     * @param writer the writer to render the document to.
+     * @param renderingContext the document's rendering context
+     * @param context the site's rendering context
+     * @throws RendererException if it bombs.
+     * @throws FileNotFoundException if it bombs.
+     * @throws UnsupportedEncodingException if it bombs.
      */
     void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext
context )
         throws RendererException, FileNotFoundException, UnsupportedEncodingException;

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java?rev=1074962&r1=1074961&r2=1074962&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
Sat Feb 26 23:38:00 2011
@@ -31,7 +31,7 @@ import org.codehaus.plexus.util.ReaderFa
 import org.codehaus.plexus.util.WriterFactory;
 
 /**
- * <p>SiteRenderingContext class.</p>
+ * Context for a site rendering.
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
@@ -50,7 +50,7 @@ public class SiteRenderingContext
 
     private Locale locale = Locale.getDefault();
 
-    private List siteLocales = new ArrayList();
+    private List/*Locale*/ siteLocales = new ArrayList/*Locale*/();
 
     private DecorationModel decoration;
 
@@ -60,11 +60,11 @@ public class SiteRenderingContext
 
     private boolean usingDefaultTemplate;
 
-    private List siteDirectories = new ArrayList();
+    private List/*File*/ siteDirectories = new ArrayList/*File*/();
 
-    private Map moduleExcludes;
+    private Map/*String, String*/ moduleExcludes;
 
-    private List modules = new ArrayList();
+    private List/*ModuleReference*/ modules = new ArrayList/*ModuleReference*/();
 
     private boolean validate;
 
@@ -167,7 +167,7 @@ public class SiteRenderingContext
      *
      * @return a {@link java.util.List} object with {@link java.util.Locale} objects.
      */
-    public List getSiteLocales()
+    public List/*Locale*/ getSiteLocales()
     {
         return siteLocales;
     }
@@ -177,7 +177,7 @@ public class SiteRenderingContext
     *
     * @param locales List of {@link java.util.Locale} objects to add to the site locales
list.
     */
-    public void addSiteLocales( List locales )
+    public void addSiteLocales( List/*Locale*/ locales )
     {
         siteLocales.addAll( locales );
     }
@@ -283,22 +283,22 @@ public class SiteRenderingContext
     }
 
     /**
-     * <p>addModuleDirectory.</p>
+     * Add a module source directory.
      *
-     * @param file a {@link java.io.File} object.
+     * @param moduleBasedir The base directory for module's source files.
      * @param moduleParserId a {@link java.lang.String} object.
      */
-    public void addModuleDirectory( File file, String moduleParserId )
+    public void addModuleDirectory( File moduleBasedir, String moduleParserId )
     {
-        this.modules.add( new ModuleReference( moduleParserId, file ) );
+        this.modules.add( new ModuleReference( moduleParserId, moduleBasedir ) );
     }
 
     /**
      * <p>Getter for the field <code>siteDirectories</code>.</p>
      *
-     * @return a {@link java.util.List} object.
+     * @return List of site directories files.
      */
-    public List getSiteDirectories()
+    public List/*File*/ getSiteDirectories()
     {
         return siteDirectories;
     }
@@ -308,7 +308,7 @@ public class SiteRenderingContext
      *
      * @return a {@link java.util.List} object.
      */
-    public List getModules()
+    public List/*ModuleReference*/ getModules()
     {
         return modules;
     }
@@ -316,9 +316,9 @@ public class SiteRenderingContext
     /**
      * <p>Getter for the field <code>moduleExcludes</code>.</p>
      *
-     * @return a {@link java.util.Map} object.
+     * @return a map defining exclude patterns (comma separated) by parser id.
      */
-    public Map getModuleExcludes()
+    public Map/*String, String*/ getModuleExcludes()
     {
         return moduleExcludes;
     }
@@ -328,7 +328,7 @@ public class SiteRenderingContext
      *
      * @param moduleExcludes a {@link java.util.Map} object.
      */
-    public void setModuleExcludes( Map moduleExcludes )
+    public void setModuleExcludes( Map/*String, String*/ moduleExcludes )
     {
         this.moduleExcludes = moduleExcludes;
     }



Mime
View raw message