Author: vsiveton
Date: Fri Feb 15 16:07:22 2008
New Revision: 628206

URL: http://svn.apache.org/viewvc?rev=628206&view=rev
Log:
DOXIA-56: clean up doxia api and code

o renamed StructureSink to StructureSinkUtils

Added:
    
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSinkUtils.java
      - copied, changed from r628205, 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSink.java
    
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java
      - copied, changed from r628205, 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkTest.java
Removed:
    
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSink.java
    
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkTest.java
Modified:
    
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
    
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=628206&r1=628205&r2=628206&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
 Fri Feb 15 16:07:22 2008
@@ -30,7 +30,7 @@
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.AbstractXmlSink;
 import org.apache.maven.doxia.util.HtmlTools;
-import org.apache.maven.doxia.util.StructureSink;
+import org.apache.maven.doxia.util.StructureSinkUtils;
 
 /**
  * Abstract base xhtml sink implementation.
@@ -948,7 +948,7 @@
             att.addAttribute( Attribute.TARGET, target );
         }
 
-        if ( StructureSink.isExternalLink( name ) || isExternalHtml( name ) )
+        if ( StructureSinkUtils.isExternalLink( name ) || isExternalHtml( name 
) )
         {
             if ( isExternalLink( name ) )
             {
@@ -966,7 +966,7 @@
     }
 
     /**
-     * [EMAIL PROTECTED] StructureSink#isExternalLink(String)} also treats 
links to other documents as
+     * [EMAIL PROTECTED] StructureSinkUtils#isExternalLink(String)} also 
treats links to other documents as
      * external links, those should not have a class="externalLink" attribute.
      */
     private boolean isExternalLink( String href )
@@ -1203,7 +1203,7 @@
      */
     public static String encodeFragment( String text )
     {
-        return encodeURL( StructureSink.linkToKey( text ) );
+        return encodeURL( StructureSinkUtils.linkToKey( text ) );
     }
 
     /**

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java?rev=628206&r1=628205&r2=628206&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
 Fri Feb 15 16:07:22 2008
@@ -215,7 +215,7 @@
         {
             return null;
         }
-        return encodeURL( StructureSink.linkToKey( text ) );
+        return encodeURL( StructureSinkUtils.linkToKey( text ) );
     }
 
     /**

Copied: 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSinkUtils.java
 (from r628205, 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSink.java)
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSinkUtils.java?p2=maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSinkUtils.java&p1=maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSink.java&r1=628205&r2=628206&rev=628206&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSink.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StructureSinkUtils.java
 Fri Feb 15 16:07:22 2008
@@ -20,7 +20,7 @@
  */
 
 /** Utility methods for Sinks. */
-public class StructureSink
+public class StructureSinkUtils
 {
     /**
      * Checks if the given string corresponds to an external URI,

Copied: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java
 (from r628205, 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkTest.java)
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java?p2=maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java&p1=maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkTest.java&r1=628205&r2=628206&rev=628206&view=diff
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkTest.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java
 Fri Feb 15 16:07:22 2008
@@ -19,13 +19,13 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.util.StructureSink;
+import org.apache.maven.doxia.util.StructureSinkUtils;
 import org.codehaus.plexus.PlexusTestCase;
 
 /**
  * Test for org.apache.maven.doxia.sink.StructureSink
  */
-public class StructureSinkTest
+public class StructureSinkUtilsTest
     extends PlexusTestCase
 {
 
@@ -36,44 +36,44 @@
     {
         String link = "http://maven.apache.org/";;
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "https://maven.apache.org/";;
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "ftp:/maven.apache.org/";
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "mailto:[EMAIL PROTECTED]";
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "file:/index.html";
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "./index.html";
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "../index.html";
         assertTrue( "Should be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
 
         link = "file:\\index.html";
         assertFalse( "Should NOT be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = ".\\index.html";
         assertFalse( "Should NOT be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
 
         link = "..\\index.html";
         assertFalse( "Should NOT be an external link: " + link,
-            StructureSink.isExternalLink( link ) );
+            StructureSinkUtils.isExternalLink( link ) );
     }
 
 }


Reply via email to