maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r733390 - in /maven/doxia: doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/ doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/ doxia/trunk/doxia-sink-api/src/main/...
Date Sat, 10 Jan 2009 22:40:32 GMT
Author: ltheussl
Date: Sat Jan 10 14:40:32 2009
New Revision: 733390

URL: http://svn.apache.org/viewvc?rev=733390&view=rev
Log:
Javadocs, minor code formatting.

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.java
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSinkFactory.java
    maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
    maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritanceAssembler.java
Sat Jan 10 14:40:32 2009
@@ -28,10 +28,28 @@
  */
 public interface DecorationModelInheritanceAssembler
 {
+    /**
+     * Plexus lookup role.
+     */
     String ROLE = DecorationModelInheritanceAssembler.class.getName();
 
+    /**
+     * Manage inheritance of the decoration model between a parent and child.
+     *
+     * @param name a name.
+     * @param child the child DecorationModel.
+     * @param parent the parent DecorationModel.
+     * @param childBaseUrl the child nase URL.
+     * @param parentBaseUrl the parent base URL.
+     */
     void assembleModelInheritance( String name, DecorationModel child, DecorationModel parent,
String childBaseUrl,
                                    String parentBaseUrl );
 
+    /**
+     * Resolve relative paths for a DecorationModel given a base URL.
+     *
+     * @param decoration  the DecorationModel.
+     * @param baseUrl the base URL.
+     */
     void resolvePaths( DecorationModel decoration, String baseUrl );
 }

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/DefaultDecorationModelInheritanceAssembler.java
Sat Jan 10 14:40:32 2009
@@ -42,6 +42,7 @@
  */
 public class DefaultDecorationModelInheritanceAssembler implements DecorationModelInheritanceAssembler
 {
+    /** {@inheritDoc} */
     public void assembleModelInheritance( String name, DecorationModel child, DecorationModel
parent,
                                           String childBaseUrl, String parentBaseUrl )
     {
@@ -86,9 +87,10 @@
         }
     }
 
-    public void resolvePaths( final DecorationModel decoration, final String childBaseUrl
)
+    /** {@inheritDoc} */
+    public void resolvePaths( final DecorationModel decoration, final String baseUrl )
     {
-        URLContainer urlContainer = new URLContainer( null, childBaseUrl );
+        URLContainer urlContainer = new URLContainer( null, baseUrl );
 
         if ( decoration.getBannerLeft() != null )
         {
@@ -137,8 +139,7 @@
      * to the oldBaseUrl, these are changed to the newBannerUrl.
      *
      * @param banner
-     * @param prefix
-     * @param baseUrl
+     * @param urlContainer
      */
     private void resolveBannerPaths( final Banner banner, final URLContainer urlContainer
)
     {
@@ -149,7 +150,7 @@
         }
     }
 
-    private void assembleCustomInheritance( DecorationModel child, DecorationModel parent
)
+    private void assembleCustomInheritance( final DecorationModel child, final DecorationModel
parent )
     {
         if ( child.getCustom() == null )
         {
@@ -248,7 +249,7 @@
         }
     }
 
-    private void resolveLinkItemPaths( LinkItem item, final URLContainer urlContainer )
+    private void resolveLinkItemPaths( final LinkItem item, final URLContainer urlContainer
)
     {
         if ( item.getHref() != null )
         {
@@ -341,6 +342,9 @@
         }
     }
 
+    /**
+     * Contains an old and a new path.
+     */
     public final class URLContainer
     {
 
@@ -348,17 +352,33 @@
 
         private final String newPath;
 
+        /**
+         * Construct a URLContainer.
+         *
+         * @param oldPath the old path.
+         * @param newPath the new path.
+         */
         public URLContainer( final String oldPath, final String newPath )
         {
             this.oldPath = oldPath;
             this.newPath = newPath;
         }
 
+        /**
+         * Get the new path.
+         *
+         * @return the new path.
+         */
         public String getNewPath()
         {
             return this.newPath;
         }
 
+        /**
+         * Get the old path.
+         *
+         * @return the old path.
+         */
         public String getOldPath()
         {
             return this.oldPath;

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptor.java
Sat Jan 10 14:40:32 2009
@@ -42,31 +42,55 @@
 
     private final String relativePath;
 
+    /**
+     * Construct a PathDescriptor from a path.
+     *
+     * @param path the path.
+     *
+     * @throws java.net.MalformedURLException if a URL cannot be formed from the path.
+     */
     public PathDescriptor( final String path ) throws MalformedURLException
     {
         this( (URL) null, path );
     }
 
+    /**
+     * Construct a PathDescriptor from a path and a base.
+     *
+     * @param base a base reference.
+     * @param path the path.
+     *
+     * @throws java.net.MalformedURLException if a URL cannot be formed from the path.
+     */
     public PathDescriptor( final String base, final String path ) throws MalformedURLException
     {
         this( PathDescriptor.buildBaseUrl( base ), path );
     }
 
+    /**
+     * Construct a PathDescriptor from a path and a base.
+     *
+     * @param baseUrl a base reference.
+     * @param path the path.
+     *
+     * @throws java.net.MalformedURLException if a URL cannot be formed from the path.
+     */
     public PathDescriptor( final URL baseUrl, final String path ) throws MalformedURLException
     {
         this.baseUrl = baseUrl;
 
-        URL pathUrl = null;
-        String relativePath = null;
+        URL pathURL = null;
+        String relPath = null;
+
         try
         {
-            pathUrl = new URL( path );
+            pathURL = new URL( path );
         }
         catch ( MalformedURLException e )
         {
             try
             {
-                pathUrl = buildUrl( baseUrl, path );
+                pathURL = buildUrl( baseUrl, path );
             }
             catch ( MalformedURLException e2 )
             {
@@ -75,19 +99,20 @@
                 // to which it has been anchored.
                 if ( path != null && path.startsWith( "/" ) )
                 {
-                    relativePath = path.substring( 1 );
+                    relPath = path.substring( 1 );
                 }
                 else
                 {
-                    relativePath = path;
+                    relPath = path;
                 }
             }
         }
-        this.pathUrl = pathUrl;
-        this.relativePath = relativePath;
+
+        this.pathUrl = pathURL;
+        this.relativePath = relPath;
     }
 
-    private static final URL buildBaseUrl( final String base ) throws MalformedURLException
+    private static URL buildBaseUrl( final String base ) throws MalformedURLException
     {
         if ( base == null )
         {
@@ -100,11 +125,11 @@
         }
         catch ( MalformedURLException e )
         {
-            return new File( base ).toURL();
+            return new File( base ).toURI().toURL();
         }
     }
 
-    private static final URL buildUrl( final URL baseUrl, final String path ) throws MalformedURLException
+    private static URL buildUrl( final URL baseUrl, final String path ) throws MalformedURLException
     {
         if ( baseUrl == null )
         {
@@ -118,7 +143,7 @@
 
         if ( baseUrl.getProtocol().equals( "file" ) )
         {
-            return new File( baseUrl.getFile(), path ).toURL();
+            return new File( baseUrl.getFile(), path ).toURI().toURL();
         }
 
         if ( path.startsWith( "/" ) && baseUrl.getPath().endsWith( "/" ) )
@@ -129,26 +154,51 @@
         return new URL( baseUrl, path );
     }
 
+    /**
+     * Check if this PathDescriptor decribes a file.
+     *
+     * @return true for file, false otherwise.
+     */
     public boolean isFile()
     {
         return isRelative() || pathUrl.getProtocol().equals( "file" );
     }
 
+    /**
+     * Check if this PathDescriptor decribes a relative path.
+     *
+     * @return true if {@link #getPathUrl()} returns null.
+     */
     public boolean isRelative()
     {
         return pathUrl == null;
     }
 
+    /**
+     * Get the base URL.
+     *
+     * @return the base URL.
+     */
     public URL getBaseUrl()
     {
         return baseUrl;
     }
 
+    /**
+     * Get the path as a URL.
+     *
+     * @return the path as a URL.
+     */
     public URL getPathUrl()
     {
         return pathUrl;
     }
 
+    /**
+     * Get the path.
+     *
+     * @return the path.
+     */
     public String getPath()
     {
         if ( getPathUrl() != null )
@@ -168,6 +218,11 @@
         }
     }
 
+    /**
+     * Get the location for files.
+     *
+     * @return the location.
+     */
     public String getLocation()
     {
         if ( isFile() )
@@ -187,6 +242,7 @@
         }
     }
 
+    /** {@inheritDoc} */
     public String toString()
     {
         StringBuffer res =

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSinkFactory.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSinkFactory.java
Sat Jan 10 14:40:32 2009
@@ -39,8 +39,12 @@
     implements SinkFactory
 {
     /**
+     * Create a text Sink for a given encoding.
+     *
      * @param writer The writer for the sink output, never <code>null</code>.
      * @param encoding The character encoding used by the writer.
+     *
+     * @return a Sink for text output in the given encoding.
      */
     protected abstract Sink createSink( Writer writer, String encoding );
 

Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
(original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
Sat Jan 10 14:40:32 2009
@@ -319,7 +319,7 @@
     String HEADERS = "headers";
 
     /**
-     * Whether to disable or enable automatic text wrapping for an element. 
+     * Whether to disable or enable automatic text wrapping for an element.
      */
     String NOWRAP = "nowrap";
 

Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java?rev=733390&r1=733389&r2=733390&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java
(original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java
Sat Jan 10 14:40:32 2009
@@ -40,8 +40,10 @@
      *
      * @param outputDir the not-null output dir.
      * @param outputName the not-null output name.
+     *
      * @return a <code>Sink</code> instance with a file as output.
-     * @throws IOException if any
+     *
+     * @throws java.io.IOException if any
      */
     Sink createSink( File outputDir, String outputName )
         throws IOException;
@@ -52,10 +54,14 @@
      * @param outputDir the not-null output dir.
      * @param outputName the not-null output name.
      * @param encoding the output encoding.
+     *
      * @return a <code>Sink</code> instance with a file as output and using specified
encoding.
-     * @throws IOException if any
+     *
+     * @throws java.io.IOException if any
+     *
      * @see #createSink(File, String)
-     * @since 1.0-beta-1
+     *
+     * @since 1.1
      */
     Sink createSink( File outputDir, String outputName, String encoding )
         throws IOException;
@@ -64,8 +70,12 @@
      * Create a <code>Sink</code> into an OutputStream.
      *
      * @param out not null OutputStream to write the result.
+     *
      * @return a <code>Sink</code> instance.
-     * @since 1.0-beta-1
+     *
+     * @throws java.io.IOException if any
+     *
+     * @since 1.1
      */
     Sink createSink( OutputStream out )
         throws IOException;
@@ -75,8 +85,12 @@
      *
      * @param out not null OutputStream to write the result.
      * @param encoding the output encoding.
+     *
      * @return a <code>Sink</code> instance using specified encoding.
-     * @since 1.0-beta-1
+     *
+     * @throws java.io.IOException if any
+     *
+     * @since 1.1
      */
     Sink createSink( OutputStream out, String encoding )
         throws IOException;



Mime
View raw message