maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r562687 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src: main/java/org/apache/maven/doxia/module/apt/ test/java/org/apache/maven/doxia/module/apt/
Date Sat, 04 Aug 2007 10:45:16 GMT
Author: vsiveton
Date: Sat Aug  4 03:45:15 2007
New Revision: 562687

URL: http://svn.apache.org/viewvc?view=rev&rev=562687
Log:
o using new abstract Parser/Sink classes

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java?view=diff&rev=562687&r1=562686&r2=562687
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java Sat Aug  4 03:45:15 2007
@@ -15,6 +15,7 @@
  * the License.
  */
 
+import org.apache.maven.doxia.markup.TextMarkup;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -27,173 +28,134 @@
  * @since 1.0
  */
 public interface AptMarkup
+    extends TextMarkup
 {
-    /** The vm line separator */
-    /** TODO should be in a super interface */
-    String EOL = System.getProperty( "line.separator" );
-
     // ----------------------------------------------------------------------
     // Markup separators
     // ----------------------------------------------------------------------
 
-    /** APT comment markup char: '~' */
-    char COMMENT_MARKUP = '~';
-
-    /** APT space markup char: ' ' */
-    char SPACE_MARKUP = ' ';
-
-    /** APT tab markup char: '\t' */
-    char TAB_MARKUP = '\t';
-
     /** APT backslash markup char: '\\' */
-    char BACKSLASH_MARKUP = '\\';
-
-    /** APT star markup char: '*' */
-    char STAR_MARKUP = '*';
-
-    /** APT plus markup char: '+' */
-    char PLUS_MARKUP = '+';
-
-    /** APT minus markup char: '-' */
-    char MINUS_MARKUP = '-';
-
-    /** APT equal markup char: '=' */
-    char EQUAL_MARKUP = '=';
+    char BACKSLASH = '\\';
 
-    /** APT pipe markup char: '|' */
-    char PIPE_MARKUP = '|';
+    /** colon character: ':' */
+    char COLON = ':';
 
-    /** APT left curly bracket markup char: '{' */
-    char LEFT_CURLY_BRACKET_MARKUP = '{';
-
-    /** APT right curly bracket markup char: '}' */
-    char RIGHT_CURLY_BRACKET_MARKUP = '}';
-
-    /** APT left square bracket markup char: '[' */
-    char LEFT_SQUARE_BRACKET_MARKUP = '[';
-
-    /** APT right square bracket markup char: ']' */
-    char RIGHT_SQUARE_BRACKET_MARKUP = ']';
-
-    /** APT less than markup char: '<' */
-    char LESS_THAN_MARKUP = '<';
+    /** APT comment markup char: '~' */
+    char COMMENT = '~';
 
-    /** APT greater than markup char: '>' */
-    char GREATER_THAN_MARKUP = '>';
+    /** APT numbering decimal markup char: '1' */
+    char NUMBERING = '1';
 
     /** APT numbering lower alpha markup char: 'a' */
-    char NUMBERING_LOWER_ALPHA_MARKUP = 'a';
-
-    /** APT numbering upper alpha markup char: 'A' */
-    char NUMBERING_UPPER_ALPHA_MARKUP = 'A';
+    char NUMBERING_LOWER_ALPHA_CHAR = 'a';
 
     /** APT numbering lower roman markup char: 'i' */
-    char NUMBERING_LOWER_ROMAN_MARKUP = 'i';
+    char NUMBERING_LOWER_ROMAN_CHAR = 'i';
 
-    /** APT numbering upper roman markup char: 'I' */
-    char NUMBERING_UPPER_ROMAN_MARKUP = 'I';
+    /** APT numbering upper alpha markup char: 'A' */
+    char NUMBERING_UPPER_ALPHA_CHAR = 'A';
 
-    /** APT numbering decimal markup char: '1' */
-    char NUMBERING_MARKUP = '1';
+    /** APT numbering upper roman markup char: 'I' */
+    char NUMBERING_UPPER_ROMAN_CHAR = 'I';
 
     /** APT page break markup char: '\f' */
-    char PAGE_BREAK_MARKUP = '\f';
+    char PAGE_BREAK = '\f';
 
     /** APT percent markup char: '%' */
-    char PERCENT_MARKUP = '%';
+    char PERCENT = '%';
 
-    /** APT colon markup char: ':' */
-    char COLON_MARKUP = ':';
+    /** APT tab markup char: '\t' */
+    char TAB = '\t';
 
     // ----------------------------------------------------------------------
     // Markup syntax
     // ----------------------------------------------------------------------
 
-    /** Syntax for the header start: " -----" */
-    String HEADER_START = SPACE_MARKUP + StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 5 );
-
-    /** Syntax for the section title start: "*" */
-    String SECTION_TITLE_START = String.valueOf( STAR_MARKUP );
+    /** Syntax for the anchor end: "}" */
+    String ANCHOR_END_MARKUP = String.valueOf( RIGHT_CURLY_BRACKET );
 
-    /** Syntax for the list start: "*" */
-    String LIST_START = String.valueOf( STAR_MARKUP );
+    /** Syntax for the anchor start: "{" */
+    String ANCHOR_START_MARKUP = String.valueOf( LEFT_CURLY_BRACKET );
 
-    /** Syntax for the list end: "[]" */
-    String LIST_END = String.valueOf( LEFT_SQUARE_BRACKET_MARKUP ) + String.valueOf( RIGHT_SQUARE_BRACKET_MARKUP );
+    /** Syntax for the bold style end: ">>" */
+    String BOLD_END_MARKUP = StringUtils.repeat( String.valueOf( GREATER_THAN ), 2 );
 
-    /** Syntax for the page break: "\f" */
-    String PAGE_BREAK = String.valueOf( PAGE_BREAK_MARKUP );
+    /** Syntax for the bold style start: "<<" */
+    String BOLD_START_MARKUP = StringUtils.repeat( String.valueOf( LESS_THAN ), 2 );
 
     /** Syntax for the boxed verbatim start: "+------+" */
-    String BOXED_VERBATIM_START = String.valueOf( PLUS_MARKUP )
-        + StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 6 ) + String.valueOf( PLUS_MARKUP );
+    String BOXED_VERBATIM_START_MARKUP = String.valueOf( PLUS )
+        + StringUtils.repeat( String.valueOf( MINUS ), 6 ) + String.valueOf( PLUS );
 
-    /** Syntax for the boxed verbatim end: "+------+" */
-    String BOXED_VERBATIM_END = BOXED_VERBATIM_START;
+    /** Syntax for the header start: " -----" */
+    String HEADER_START_MARKUP = String.valueOf( SPACE ) + StringUtils.repeat( String.valueOf( MINUS ), 5 );
 
-    /** Syntax for the non boxed verbatim start: "------" */
-    String NON_BOXED_VERBATIM_START = StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 6 );
+    /** Syntax for the horizontal rule: "========" */
+    String HORIZONTAL_RULE_MARKUP = StringUtils.repeat( String.valueOf( EQUAL ), 8 );
 
-    /** Syntax for the non boxed verbatim end: "------" */
-    String NON_BOXED_VERBATIM_END = NON_BOXED_VERBATIM_START;
+    /** Syntax for the italic style end: ">" */
+    String ITALIC_END_MARKUP = String.valueOf( GREATER_THAN );
 
-    /** Syntax for the horizontal rule: "========" */
-    String HORIZONTAL_RULE = StringUtils.repeat( String.valueOf( EQUAL_MARKUP ), 8 );
+    /** Syntax for the italic style start: "<" */
+    String ITALIC_START_MARKUP = String.valueOf( LESS_THAN );
 
-    /** Syntax for the table row start: "*--" */
-    String TABLE_ROW_START = STAR_MARKUP + StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 2 );
+    /** Syntax for the link end: "}}" */
+    String LINK_END_MARKUP = StringUtils.repeat( String.valueOf( RIGHT_CURLY_BRACKET ), 2 );
 
-    /** Syntax for the table row end: "|" */
-    String TABLE_ROW_SEPARATOR = String.valueOf( PIPE_MARKUP );
+    /** Syntax for the link start: "{{{" */
+    String LINK_START_1_MARKUP = StringUtils.repeat( String.valueOf( LEFT_CURLY_BRACKET ), 3 );
 
-    /** Syntax for the table column, left style: "-+" */
-    String TABLE_COL_LEFT_ALIGNED = StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 2 )
-        + String.valueOf( PLUS_MARKUP );
+    /** Syntax for the link start: "}" */
+    String LINK_START_2_MARKUP = String.valueOf( RIGHT_CURLY_BRACKET );
 
-    /** Syntax for the table column, centered style: "-*" */
-    String TABLE_COL_CENTERED_ALIGNED = StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 2 )
-        + String.valueOf( STAR_MARKUP );
+    /** Syntax for the list end: "[]" */
+    String LIST_END_MARKUP = String.valueOf( LEFT_SQUARE_BRACKET ) + String.valueOf( RIGHT_SQUARE_BRACKET );
 
-    /** Syntax for the table column, right style: "-:" */
-    String TABLE_COL_RIGHT_ALIGNED = StringUtils.repeat( String.valueOf( MINUS_MARKUP ), 2 )
-        + String.valueOf( COLON_MARKUP );
+    /** Syntax for the list start: "*" */
+    String LIST_START_MARKUP = String.valueOf( STAR );
 
-    /** Syntax for the table cell start: "|" */
-    String TABLE_CELL_SEPARATOR = String.valueOf( PIPE_MARKUP );
+    /** Syntax for the mono-spaced style end: ">>>" */
+    String MONOSPACED_END_MARKUP = StringUtils.repeat( String.valueOf( GREATER_THAN ), 3 );
 
-    /** Syntax for the anchor start: "{" */
-    String ANCHOR_START = String.valueOf( LEFT_CURLY_BRACKET_MARKUP );
+    /** Syntax for the mono-spaced style start: "<<<" */
+    String MONOSPACED_START_MARKUP = StringUtils.repeat( String.valueOf( LESS_THAN ), 3 );
 
-    /** Syntax for the anchor end: "}" */
-    String ANCHOR_END = String.valueOf( RIGHT_CURLY_BRACKET_MARKUP );
+    /** Syntax for the non boxed verbatim start: "------" */
+    String NON_BOXED_VERBATIM_START_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 6 );
 
-    /** Syntax for the link start: "{{{" */
-    String LINK_START_1 = StringUtils.repeat( String.valueOf( LEFT_CURLY_BRACKET_MARKUP ), 3 );
+    /** Syntax for the non breaking space: "\ " */
+    String NON_BREAKING_SPACE_MARKUP = String.valueOf( BACKSLASH ) + String.valueOf( SPACE );
 
-    /** Syntax for the link start: "}" */
-    String LINK_START_2 = String.valueOf( RIGHT_CURLY_BRACKET_MARKUP );
+    /** Syntax for the page break: "\f" */
+    String PAGE_BREAK_MARKUP = String.valueOf( PAGE_BREAK );
 
-    /** Syntax for the link end: "}}" */
-    String LINK_END = StringUtils.repeat( String.valueOf( RIGHT_CURLY_BRACKET_MARKUP ), 2 );
+    /** Syntax for the section title start: "*" */
+    String SECTION_TITLE_START_MARKUP = String.valueOf( STAR );
 
-    /** Syntax for the italic style start: "<" */
-    String ITALIC_START = String.valueOf( LESS_THAN_MARKUP );
+    /** Syntax for the table cell start: "|" */
+    String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf( PIPE );
 
-    /** Syntax for the italic style end: ">" */
-    String ITALIC_END = String.valueOf( GREATER_THAN_MARKUP );
+    /** Syntax for the table column, centered style: "-*" */
+    String TABLE_COL_CENTERED_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
+        + String.valueOf( STAR );
 
-    /** Syntax for the bold style start: "<<" */
-    String BOLD_START = StringUtils.repeat( String.valueOf( LESS_THAN_MARKUP ), 2 );
+    /** Syntax for the table column, left style: "-+" */
+    String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
+        + String.valueOf( PLUS );
 
-    /** Syntax for the bold style end: ">>" */
-    String BOLD_END = StringUtils.repeat( String.valueOf( GREATER_THAN_MARKUP ), 2 );
+    /** Syntax for the table column, right style: "-:" */
+    String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
+        + String.valueOf( COLON );
 
-    /** Syntax for the mono-spaced style start: "<<<" */
-    String MONOSPACED_START = StringUtils.repeat( String.valueOf( LESS_THAN_MARKUP ), 3 );
+    /** Syntax for the table row end: "|" */
+    String TABLE_ROW_SEPARATOR_MARKUP = String.valueOf( PIPE );
 
-    /** Syntax for the mono-spaced style end: ">>>" */
-    String MONOSPACED_END = StringUtils.repeat( String.valueOf( GREATER_THAN_MARKUP ), 3 );
+    /** Syntax for the table row start: "*--" */
+    String TABLE_ROW_START_MARKUP = String.valueOf( STAR ) + StringUtils.repeat( String.valueOf( MINUS ), 2 );
 
-    /** Syntax for the non breaking space: "\ " */
-    String NON_BREAKING_SPACE = String.valueOf( BACKSLASH_MARKUP ) + String.valueOf( SPACE_MARKUP );
+    /** Syntax for the boxed verbatim end: "+------+" */
+    String BOXED_VERBATIM_END_MARKUP = BOXED_VERBATIM_START_MARKUP;
+
+    /** Syntax for the non boxed verbatim end: "------" */
+    String NON_BOXED_VERBATIM_END_MARKUP = NON_BOXED_VERBATIM_START_MARKUP;
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?view=diff&rev=562687&r1=562686&r2=562687
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Sat Aug  4 03:45:15 2007
@@ -22,7 +22,7 @@
 import org.apache.maven.doxia.macro.MacroExecutionException;
 import org.apache.maven.doxia.macro.MacroRequest;
 import org.apache.maven.doxia.macro.manager.MacroNotFoundException;
-import org.apache.maven.doxia.parser.AbstractParser;
+import org.apache.maven.doxia.parser.AbstractTextParser;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkAdapter;
 import org.codehaus.plexus.util.IOUtil;
@@ -45,7 +45,7 @@
  * @plexus.component role="org.apache.maven.doxia.parser.Parser" role-hint="apt"
  */
 public class AptParser
-    extends AbstractParser
+    extends AbstractTextParser
     implements AptMarkup
 {
     /** Title event id */
@@ -648,14 +648,14 @@
             {
                 switch ( line.charAt( i ) )
                 {
-                    case SPACE_MARKUP:
+                    case SPACE:
                         ++indent;
                         break;
-                    case TAB_MARKUP:
+                    case TAB:
                         indent += 8;
                         break;
-                    case COMMENT_MARKUP:
-                        if ( charAt( line, length, i + 1 ) == COMMENT_MARKUP )
+                    case COMMENT:
+                        if ( charAt( line, length, i + 1 ) == COMMENT )
                         {
                             // Comment.
                             i = length;
@@ -681,18 +681,18 @@
         block = null;
         switch ( line.charAt( i ) )
         {
-            case STAR_MARKUP:
+            case STAR:
                 if ( indent == 0 )
                 {
-                    if ( charAt( line, length, i + 1 ) == MINUS_MARKUP && charAt( line, length, i + 2 ) == MINUS_MARKUP )
+                    if ( charAt( line, length, i + 1 ) == MINUS && charAt( line, length, i + 2 ) == MINUS )
                     {
                         block = new Table( indent, line );
                     }
-                    else if ( charAt( line, length, i + 1 ) == STAR_MARKUP )
+                    else if ( charAt( line, length, i + 1 ) == STAR )
                     {
-                        if ( charAt( line, length, i + 2 ) == STAR_MARKUP )
+                        if ( charAt( line, length, i + 2 ) == STAR )
                         {
-                            if ( charAt( line, length, i + 3 ) == STAR_MARKUP )
+                            if ( charAt( line, length, i + 3 ) == STAR )
                             {
                                 block = new Section5( indent, line );
                             }
@@ -716,8 +716,8 @@
                     block = new ListItem( indent, line );
                 }
                 break;
-            case LEFT_SQUARE_BRACKET_MARKUP:
-                if ( charAt( line, length, i + 1 ) == RIGHT_SQUARE_BRACKET_MARKUP )
+            case LEFT_SQUARE_BRACKET:
+                if ( charAt( line, length, i + 1 ) == RIGHT_SQUARE_BRACKET )
                 {
                     block = new ListBreak( indent, line );
                 }
@@ -729,25 +729,25 @@
                     }
                     else
                     {
-                        if ( charAt( line, length, i + 1 ) == LEFT_SQUARE_BRACKET_MARKUP )
+                        if ( charAt( line, length, i + 1 ) == LEFT_SQUARE_BRACKET )
                         {
                             int numbering;
 
                             switch ( charAt( line, length, i + 2 ) )
                             {
-                                case NUMBERING_LOWER_ALPHA_MARKUP:
+                                case NUMBERING_LOWER_ALPHA_CHAR:
                                     numbering = Sink.NUMBERING_LOWER_ALPHA;
                                     break;
-                                case NUMBERING_UPPER_ALPHA_MARKUP:
+                                case NUMBERING_UPPER_ALPHA_CHAR:
                                     numbering = Sink.NUMBERING_UPPER_ALPHA;
                                     break;
-                                case NUMBERING_LOWER_ROMAN_MARKUP:
+                                case NUMBERING_LOWER_ROMAN_CHAR:
                                     numbering = Sink.NUMBERING_LOWER_ROMAN;
                                     break;
-                                case NUMBERING_UPPER_ROMAN_MARKUP:
+                                case NUMBERING_UPPER_ROMAN_CHAR:
                                     numbering = Sink.NUMBERING_UPPER_ROMAN;
                                     break;
-                                case NUMBERING_MARKUP:
+                                case NUMBERING:
                                 default:
                                     // The first item establishes the numbering
                                     // scheme for the whole list.
@@ -763,8 +763,8 @@
                     }
                 }
                 break;
-            case MINUS_MARKUP:
-                if ( charAt( line, length, i + 1 ) == MINUS_MARKUP && charAt( line, length, i + 2 ) == MINUS_MARKUP )
+            case MINUS:
+                if ( charAt( line, length, i + 1 ) == MINUS && charAt( line, length, i + 2 ) == MINUS )
                 {
                     if ( indent == 0 )
                     {
@@ -779,26 +779,26 @@
                     }
                 }
                 break;
-            case PLUS_MARKUP:
-                if ( indent == 0 && charAt( line, length, i + 1 ) == MINUS_MARKUP && charAt( line, length, i + 2 ) == MINUS_MARKUP )
+            case PLUS:
+                if ( indent == 0 && charAt( line, length, i + 1 ) == MINUS && charAt( line, length, i + 2 ) == MINUS )
                 {
                     block = new Verbatim( indent, line );
                 }
                 break;
-            case EQUAL_MARKUP:
-                if ( indent == 0 && charAt( line, length, i + 1 ) == EQUAL_MARKUP && charAt( line, length, i + 2 ) == EQUAL_MARKUP )
+            case EQUAL:
+                if ( indent == 0 && charAt( line, length, i + 1 ) == EQUAL && charAt( line, length, i + 2 ) == EQUAL )
                 {
                     block = new HorizontalRule( indent, line );
                 }
                 break;
-            case PAGE_BREAK_MARKUP:
+            case PAGE_BREAK:
                 if ( indent == 0 )
                 {
                     block = new PageBreak( indent, line );
                 }
                 break;
-            case PERCENT_MARKUP:
-                if ( indent == 0 && charAt( line, length, i + 1 ) == LEFT_CURLY_BRACKET_MARKUP )
+            case PERCENT:
+                if ( indent == 0 && charAt( line, length, i + 1 ) == LEFT_CURLY_BRACKET )
                 {
                     block = new MacroBlock( indent, line );
                 }
@@ -857,8 +857,8 @@
         {
             switch ( string.charAt( i ) )
             {
-                case SPACE_MARKUP:
-                case TAB_MARKUP:
+                case SPACE:
+                case TAB:
                     break;
                 default:
                     break loop;
@@ -885,13 +885,13 @@
             char c = text.charAt( i );
             switch ( c )
             {
-                case BACKSLASH_MARKUP:
+                case BACKSLASH:
                     if ( i + 1 < end )
                     {
                         char escaped = text.charAt( i + 1 );
                         switch ( escaped )
                         {
-                            case SPACE_MARKUP:
+                            case SPACE:
                                 ++i;
                                 flushTraversed( buffer, sink );
                                 sink.nonBreakingSpace();
@@ -907,19 +907,19 @@
                                 flushTraversed( buffer, sink );
                                 sink.lineBreak();
                                 break;
-                            case BACKSLASH_MARKUP:
-                            case PIPE_MARKUP:
-                            case COMMENT_MARKUP:
-                            case EQUAL_MARKUP:
-                            case MINUS_MARKUP:
-                            case PLUS_MARKUP:
-                            case STAR_MARKUP:
-                            case LEFT_SQUARE_BRACKET_MARKUP:
-                            case RIGHT_SQUARE_BRACKET_MARKUP:
-                            case LESS_THAN_MARKUP:
-                            case GREATER_THAN_MARKUP:
-                            case LEFT_CURLY_BRACKET_MARKUP:
-                            case RIGHT_CURLY_BRACKET_MARKUP:
+                            case BACKSLASH:
+                            case PIPE:
+                            case COMMENT:
+                            case EQUAL:
+                            case MINUS:
+                            case PLUS:
+                            case STAR:
+                            case LEFT_SQUARE_BRACKET:
+                            case RIGHT_SQUARE_BRACKET:
+                            case LESS_THAN:
+                            case GREATER_THAN:
+                            case LEFT_CURLY_BRACKET:
+                            case RIGHT_CURLY_BRACKET:
                                 ++i;
                                 buffer.append( escaped );
                                 break;
@@ -942,7 +942,7 @@
                                 }
                                 else
                                 {
-                                    buffer.append( BACKSLASH_MARKUP );
+                                    buffer.append( BACKSLASH );
                                 }
                                 break;
                             case 'u':
@@ -965,7 +965,7 @@
                                 }
                                 else
                                 {
-                                    buffer.append( BACKSLASH_MARKUP );
+                                    buffer.append( BACKSLASH );
                                 }
                                 break;
                             default:
@@ -995,20 +995,20 @@
                                 }
                                 else
                                 {
-                                    buffer.append( BACKSLASH_MARKUP );
+                                    buffer.append( BACKSLASH );
                                 }
                         }
                     }
                     else
                     {
-                        buffer.append( BACKSLASH_MARKUP );
+                        buffer.append( BACKSLASH );
                     }
                     break;
 
-                case LEFT_CURLY_BRACKET_MARKUP: /*}*/
+                case LEFT_CURLY_BRACKET: /*}*/
                     if ( !anchor && !link )
                     {
-                        if ( i + 1 < end && text.charAt( i + 1 ) == LEFT_CURLY_BRACKET_MARKUP /*}*/ )
+                        if ( i + 1 < end && text.charAt( i + 1 ) == LEFT_CURLY_BRACKET /*}*/ )
                         {
                             ++i;
                             link = true;
@@ -1016,7 +1016,7 @@
 
                             String linkAnchor = null;
 
-                            if ( i + 1 < end && text.charAt( i + 1 ) == LEFT_CURLY_BRACKET_MARKUP /*}*/ )
+                            if ( i + 1 < end && text.charAt( i + 1 ) == LEFT_CURLY_BRACKET /*}*/ )
                             {
                                 ++i;
                                 StringBuffer buf = new StringBuffer();
@@ -1044,8 +1044,8 @@
                     }
                     break;
 
-                case /*{*/ RIGHT_CURLY_BRACKET_MARKUP:
-                    if ( link && i + 1 < end && text.charAt( i + 1 ) == /*{*/ RIGHT_CURLY_BRACKET_MARKUP )
+                case /*{*/ RIGHT_CURLY_BRACKET:
+                    if ( link && i + 1 < end && text.charAt( i + 1 ) == /*{*/ RIGHT_CURLY_BRACKET )
                     {
                         ++i;
                         link = false;
@@ -1064,12 +1064,12 @@
                     }
                     break;
 
-                case LESS_THAN_MARKUP:
+                case LESS_THAN:
                     if ( !italic && !bold && !monospaced )
                     {
-                        if ( i + 1 < end && text.charAt( i + 1 ) == LESS_THAN_MARKUP )
+                        if ( i + 1 < end && text.charAt( i + 1 ) == LESS_THAN )
                         {
-                            if ( i + 2 < end && text.charAt( i + 2 ) == LESS_THAN_MARKUP )
+                            if ( i + 2 < end && text.charAt( i + 2 ) == LESS_THAN )
                             {
                                 i += 2;
                                 monospaced = true;
@@ -1097,15 +1097,15 @@
                     }
                     break;
 
-                case GREATER_THAN_MARKUP:
-                    if ( monospaced && i + 2 < end && text.charAt( i + 1 ) == GREATER_THAN_MARKUP && text.charAt( i + 2 ) == GREATER_THAN_MARKUP )
+                case GREATER_THAN:
+                    if ( monospaced && i + 2 < end && text.charAt( i + 1 ) == GREATER_THAN && text.charAt( i + 2 ) == GREATER_THAN )
                     {
                         i += 2;
                         monospaced = false;
                         flushTraversed( buffer, sink );
                         sink.monospaced_();
                     }
-                    else if ( bold && i + 1 < end && text.charAt( i + 1 ) == GREATER_THAN_MARKUP )
+                    else if ( bold && i + 1 < end && text.charAt( i + 1 ) == GREATER_THAN )
                     {
                         ++i;
                         bold = false;
@@ -1127,7 +1127,7 @@
                 default:
                     if ( Character.isWhitespace( c ) )
                     {
-                        buffer.append( SPACE_MARKUP );
+                        buffer.append( SPACE );
 
                         // Skip to the last char of a sequence of white spaces.
                         while ( i + 1 < end && Character.isWhitespace( text.charAt( i + 1 ) ) )
@@ -1144,23 +1144,23 @@
 
         if ( monospaced )
         {
-            throw new AptParseException( "missing '" + MONOSPACED_END + "'" );
+            throw new AptParseException( "missing '" + MONOSPACED_END_MARKUP + "'" );
         }
         if ( bold )
         {
-            throw new AptParseException( "missing '" + BOLD_END + "'" );
+            throw new AptParseException( "missing '" + BOLD_END_MARKUP + "'" );
         }
         if ( italic )
         {
-            throw new AptParseException( "missing '" + ITALIC_END + "'" );
+            throw new AptParseException( "missing '" + ITALIC_END_MARKUP + "'" );
         }
         if ( link )
         {
-            throw new AptParseException( "missing '" + LINK_END + "'" );
+            throw new AptParseException( "missing '" + LINK_END_MARKUP + "'" );
         }
         if ( anchor )
         {
-            throw new AptParseException( "missing '" + ANCHOR_END + "'" );
+            throw new AptParseException( "missing '" + ANCHOR_END_MARKUP + "'" );
         }
 
         flushTraversed( buffer, sink );
@@ -1189,9 +1189,9 @@
             char c = text.charAt( i );
             switch ( c )
             {
-                case RIGHT_CURLY_BRACKET_MARKUP:
+                case RIGHT_CURLY_BRACKET:
                     break loop;
-                case BACKSLASH_MARKUP:
+                case BACKSLASH:
                     if ( i + 1 < end )
                     {
                         ++i;
@@ -1199,7 +1199,7 @@
                     }
                     else
                     {
-                        linkAnchor.append( BACKSLASH_MARKUP );
+                        linkAnchor.append( BACKSLASH );
                     }
                     break;
                 default:
@@ -1208,7 +1208,7 @@
         }
         if ( i == end )
         {
-            throw new AptParseException( "missing '" + RIGHT_CURLY_BRACKET_MARKUP + "'" );
+            throw new AptParseException( "missing '" + RIGHT_CURLY_BRACKET + "'" );
         }
 
         return i;
@@ -1219,14 +1219,14 @@
                                             int end )
         throws AptParseException
     {
-        char previous2 = LEFT_CURLY_BRACKET_MARKUP;
-        char previous = LEFT_CURLY_BRACKET_MARKUP;
+        char previous2 = LEFT_CURLY_BRACKET;
+        char previous = LEFT_CURLY_BRACKET;
         int i;
 
         for ( i = begin; i < end; ++i )
         {
             char c = text.charAt( i );
-            if ( c == RIGHT_CURLY_BRACKET_MARKUP && previous == RIGHT_CURLY_BRACKET_MARKUP && previous2 != BACKSLASH_MARKUP )
+            if ( c == RIGHT_CURLY_BRACKET && previous == RIGHT_CURLY_BRACKET && previous2 != BACKSLASH )
             {
                 break;
             }
@@ -1236,7 +1236,7 @@
         }
         if ( i == end )
         {
-            throw new AptParseException( "missing '" + LEFT_CURLY_BRACKET_MARKUP + LEFT_CURLY_BRACKET_MARKUP + "'" );
+            throw new AptParseException( "missing '" + LEFT_CURLY_BRACKET + LEFT_CURLY_BRACKET + "'" );
         }
 
         return doGetTraversedLink( text, begin, i - 1 );
@@ -1247,13 +1247,13 @@
                                               int end )
         throws AptParseException
     {
-        char previous = LEFT_CURLY_BRACKET_MARKUP;
+        char previous = LEFT_CURLY_BRACKET;
         int i;
 
         for ( i = begin; i < end; ++i )
         {
             char c = text.charAt( i );
-            if ( c == RIGHT_CURLY_BRACKET_MARKUP && previous != BACKSLASH_MARKUP )
+            if ( c == RIGHT_CURLY_BRACKET && previous != BACKSLASH )
             {
                 break;
             }
@@ -1262,7 +1262,7 @@
         }
         if ( i == end )
         {
-            throw new AptParseException( "missing '" + RIGHT_CURLY_BRACKET_MARKUP + "'" );
+            throw new AptParseException( "missing '" + RIGHT_CURLY_BRACKET + "'" );
         }
 
         return doGetTraversedLink( text, begin, i );
@@ -1279,12 +1279,12 @@
         {
             public void lineBreak()
             {
-                buffer.append( SPACE_MARKUP );
+                buffer.append( SPACE );
             }
 
             public void nonBreakingSpace()
             {
-                buffer.append( SPACE_MARKUP );
+                buffer.append( SPACE );
             }
 
             public void text( String text )
@@ -1345,7 +1345,7 @@
 
                     i = skipSpace( l, length, i );
                     if ( i == length ||
-                        ( AptParser.charAt( l, length, i ) == COMMENT_MARKUP && AptParser.charAt( l, length, i + 1 ) == COMMENT_MARKUP ) )
+                        ( AptParser.charAt( l, length, i ) == COMMENT && AptParser.charAt( l, length, i + 1 ) == COMMENT ) )
                     {
                         // Stop after open or comment line and skip it.
                         // (A comment line is considered to be an open line.)
@@ -1395,7 +1395,7 @@
             int i = skipSpaceFrom( 0 );
             for ( ; i < textLength; ++i )
             {
-                if ( text.charAt( i ) != STAR_MARKUP )
+                if ( text.charAt( i ) != STAR )
                 {
                     break;
                 }
@@ -1406,11 +1406,11 @@
         protected int skipFromLeftToRightBracket( int i )
             throws AptParseException
         {
-            char previous = LEFT_SQUARE_BRACKET_MARKUP;
+            char previous = LEFT_SQUARE_BRACKET;
             for ( ++i; i < textLength; ++i )
             {
                 char c = text.charAt( i );
-                if ( c == RIGHT_SQUARE_BRACKET_MARKUP && previous != BACKSLASH_MARKUP )
+                if ( c == RIGHT_SQUARE_BRACKET && previous != BACKSLASH )
                 {
                     break;
                 }
@@ -1418,7 +1418,7 @@
             }
             if ( i == textLength )
             {
-                throw new AptParseException( "missing '" + RIGHT_SQUARE_BRACKET_MARKUP + "'" );
+                throw new AptParseException( "missing '" + RIGHT_SQUARE_BRACKET + "'" );
             }
 
             return i;
@@ -1473,8 +1473,8 @@
                 String line = lines.nextToken().trim();
                 int lineLength = line.length();
 
-                if ( AptParser.charAt( line, lineLength, 0 ) == MINUS_MARKUP && AptParser.charAt( line, lineLength, 1 ) == MINUS_MARKUP &&
-                    AptParser.charAt( line, lineLength, 2 ) == MINUS_MARKUP )
+                if ( AptParser.charAt( line, lineLength, 0 ) == MINUS && AptParser.charAt( line, lineLength, 1 ) == MINUS &&
+                    AptParser.charAt( line, lineLength, 2 ) == MINUS )
                 {
                     switch ( separator )
                     {
@@ -1731,15 +1731,15 @@
 
             StringBuffer buffer = new StringBuffer();
             char firstChar = firstLine.charAt( 0 );
-            boxed = ( firstChar == PLUS_MARKUP );
+            boxed = ( firstChar == PLUS );
 
             while ( AptParser.this.line != null )
             {
                 String l = AptParser.this.line;
                 int length = l.length();
 
-                if ( AptParser.charAt( l, length, 0 ) == firstChar && AptParser.charAt( l, length, 1 ) == MINUS_MARKUP &&
-                    AptParser.charAt( l, length, 2 ) == MINUS_MARKUP )
+                if ( AptParser.charAt( l, length, 0 ) == firstChar && AptParser.charAt( l, length, 1 ) == MINUS &&
+                    AptParser.charAt( l, length, 2 ) == MINUS )
                 {
                     AptParser.this.nextLine();
 
@@ -1756,7 +1756,7 @@
                 {
                     char c = l.charAt( i );
 
-                    if ( c == TAB_MARKUP )
+                    if ( c == TAB )
                     {
                         prevColumn = column;
 
@@ -1904,7 +1904,7 @@
                     if ( init == 1 )
                     {
                         init = 0;
-                        grid = ( AptParser.charAt( line, lineLength, 0 ) == PIPE_MARKUP );
+                        grid = ( AptParser.charAt( line, lineLength, 0 ) == PIPE );
                         AptParser.this.sink.tableRows( justification, grid );
                     }
 
@@ -1980,9 +1980,9 @@
             {
                 switch ( line.charAt( i ) )
                 {
-                    case STAR_MARKUP:
-                    case PLUS_MARKUP:
-                    case COLON_MARKUP:
+                    case STAR:
+                    case PLUS:
+                    case COLON:
                         ++columns;
                         break;
                 }
@@ -1999,13 +1999,13 @@
             {
                 switch ( line.charAt( i ) )
                 {
-                    case STAR_MARKUP:
+                    case STAR:
                         justification[columns++] = JUSTIFY_CENTER;
                         break;
-                    case PLUS_MARKUP:
+                    case PLUS:
                         justification[columns++] = JUSTIFY_LEFT;
                         break;
-                    case COLON_MARKUP:
+                    case COLON:
                         justification[columns++] = JUSTIFY_RIGHT;
                         break;
                 }
@@ -2115,11 +2115,11 @@
         {
             int i = skipSpaceFrom( 0 );
 
-            char prevChar = SPACE_MARKUP;
+            char prevChar = SPACE;
             for ( ; i < textLength; ++i )
             {
                 char c = text.charAt( i );
-                if ( c == RIGHT_SQUARE_BRACKET_MARKUP && prevChar == RIGHT_SQUARE_BRACKET_MARKUP )
+                if ( c == RIGHT_SQUARE_BRACKET && prevChar == RIGHT_SQUARE_BRACKET )
                 {
                     break;
                 }
@@ -2128,7 +2128,7 @@
 
             if ( i == textLength )
             {
-                throw new AptParseException( "missing '" + RIGHT_SQUARE_BRACKET_MARKUP + RIGHT_SQUARE_BRACKET_MARKUP + "'" );
+                throw new AptParseException( "missing '" + RIGHT_SQUARE_BRACKET + RIGHT_SQUARE_BRACKET + "'" );
             }
 
             return skipSpaceFrom( i + 1 );

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java?view=diff&rev=562687&r1=562686&r2=562687
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java Sat Aug  4 03:45:15 2007
@@ -24,7 +24,7 @@
 import java.util.Stack;
 
 import org.apache.maven.doxia.util.HtmlTools;
-import org.apache.maven.doxia.sink.SinkAdapter;
+import org.apache.maven.doxia.sink.AbstractTextSink;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -35,7 +35,7 @@
  * @plexus.component
  */
 public class AptSink
-    extends SinkAdapter
+    extends AbstractTextSink
     implements AptMarkup
 {
     // ----------------------------------------------------------------------
@@ -139,22 +139,22 @@
     {
         headerFlag = false;
 
-        write( HEADER_START + EOL );
+        write( HEADER_START_MARKUP + EOL );
         if ( title != null )
         {
             write( " " + title + EOL );
         }
-        write( HEADER_START + EOL );
+        write( HEADER_START_MARKUP + EOL );
         if ( author != null )
         {
             write( " " + author + EOL );
         }
-        write( HEADER_START + EOL );
+        write( HEADER_START_MARKUP + EOL );
         if ( date != null )
         {
             write( " " + date + EOL );
         }
-        write( HEADER_START + EOL );
+        write( HEADER_START_MARKUP + EOL );
     }
 
     /** {@inheritDoc} */
@@ -232,7 +232,7 @@
     /** {@inheritDoc} */
     public void sectionTitle2()
     {
-        write( EOL + SECTION_TITLE_START );
+        write( EOL + SECTION_TITLE_START_MARKUP );
     }
 
     /** {@inheritDoc} */
@@ -244,7 +244,7 @@
     /** {@inheritDoc} */
     public void sectionTitle3()
     {
-        write( EOL + StringUtils.repeat( SECTION_TITLE_START, 2 ) );
+        write( EOL + StringUtils.repeat( SECTION_TITLE_START_MARKUP, 2 ) );
     }
 
     /** {@inheritDoc} */
@@ -256,7 +256,7 @@
     /** {@inheritDoc} */
     public void sectionTitle4()
     {
-        write( EOL + StringUtils.repeat( SECTION_TITLE_START, 3 ) );
+        write( EOL + StringUtils.repeat( SECTION_TITLE_START_MARKUP, 3 ) );
     }
 
     /** {@inheritDoc} */
@@ -268,7 +268,7 @@
     /** {@inheritDoc} */
     public void sectionTitle5()
     {
-        write( EOL + StringUtils.repeat( SECTION_TITLE_START, 4 ) );
+        write( EOL + StringUtils.repeat( SECTION_TITLE_START_MARKUP, 4 ) );
     }
 
     /** {@inheritDoc} */
@@ -281,7 +281,7 @@
     public void list()
     {
         listNestingIndent += " ";
-        listStyles.push( LIST_START );
+        listStyles.push( LIST_START_MARKUP );
         write( EOL );
     }
 
@@ -290,7 +290,7 @@
     {
         if ( listNestingIndent.length() <= 1 )
         {
-            write( EOL + listNestingIndent + LIST_END + EOL );
+            write( EOL + listNestingIndent + LIST_END_MARKUP + EOL );
         }
         else
         {
@@ -327,20 +327,20 @@
         switch ( numbering )
         {
             case NUMBERING_UPPER_ALPHA:
-                style = "A";
+                style = String.valueOf( NUMBERING_UPPER_ALPHA_CHAR );
                 break;
             case NUMBERING_LOWER_ALPHA:
-                style = "a";
+                style = String.valueOf( NUMBERING_LOWER_ALPHA_CHAR );
                 break;
             case NUMBERING_UPPER_ROMAN:
-                style = "I";
+                style = String.valueOf( NUMBERING_UPPER_ROMAN_CHAR );
                 break;
             case NUMBERING_LOWER_ROMAN:
-                style = "i";
+                style = String.valueOf( NUMBERING_LOWER_ROMAN_CHAR );
                 break;
             case NUMBERING_DECIMAL:
             default:
-                style = "1";
+                style = String.valueOf( NUMBERING );
         }
 
         listStyles.push( style );
@@ -351,7 +351,7 @@
     {
         if ( listNestingIndent.length() <= 1 )
         {
-            write( EOL + listNestingIndent + LIST_END + EOL );
+            write( EOL + listNestingIndent + LIST_END_MARKUP + EOL );
         }
         else
         {
@@ -366,15 +366,15 @@
     public void numberedListItem()
     {
         String style = (String) listStyles.peek();
-        if ( style.equals( String.valueOf( AptParser.STAR_MARKUP ) ) )
+        if ( style.equals( String.valueOf( STAR ) ) )
         {
-            write( EOL + listNestingIndent + AptParser.STAR_MARKUP + "" + AptParser.SPACE_MARKUP );
+            write( EOL + listNestingIndent + String.valueOf( STAR ) + String.valueOf( SPACE ) );
         }
         else
         {
-            write( EOL + listNestingIndent + AptParser.LEFT_SQUARE_BRACKET_MARKUP + ""
-                + AptParser.LEFT_SQUARE_BRACKET_MARKUP + style + AptParser.RIGHT_SQUARE_BRACKET_MARKUP + ""
-                + AptParser.RIGHT_SQUARE_BRACKET_MARKUP + "" + AptParser.SPACE_MARKUP );
+            write( EOL + listNestingIndent + String.valueOf( LEFT_SQUARE_BRACKET )
+                + String.valueOf( LEFT_SQUARE_BRACKET ) + style + String.valueOf( RIGHT_SQUARE_BRACKET )
+                + String.valueOf( RIGHT_SQUARE_BRACKET ) + String.valueOf( SPACE ) );
         }
         itemFlag = true;
     }
@@ -457,11 +457,11 @@
         this.boxed = boxed;
         if ( boxed )
         {
-            write( "\n" + BOXED_VERBATIM_START + "\n" );
+            write( "\n" + BOXED_VERBATIM_START_MARKUP + "\n" );
         }
         else
         {
-            write( "\n" + NON_BOXED_VERBATIM_START + "\n" );
+            write( "\n" + NON_BOXED_VERBATIM_START_MARKUP + "\n" );
         }
     }
 
@@ -470,11 +470,11 @@
     {
         if ( boxed )
         {
-            write( "\n" + BOXED_VERBATIM_END + "\n" );
+            write( "\n" + BOXED_VERBATIM_END_MARKUP + "\n" );
         }
         else
         {
-            write( "\n" + NON_BOXED_VERBATIM_END + "\n" );
+            write( "\n" + NON_BOXED_VERBATIM_END_MARKUP + "\n" );
         }
         boxed = false;
         verbatimFlag = false;
@@ -483,7 +483,7 @@
     /** {@inheritDoc} */
     public void horizontalRule()
     {
-        write( EOL + HORIZONTAL_RULE + EOL );
+        write( EOL + HORIZONTAL_RULE_MARKUP + EOL );
     }
 
     /** {@inheritDoc} */
@@ -543,7 +543,7 @@
         // TODO: This will need to be more clever, for multi-line cells
         if ( gridFlag )
         {
-            write( TABLE_ROW_SEPARATOR );
+            write( TABLE_ROW_SEPARATOR_MARKUP );
         }
 
         write( buffer.toString() );
@@ -560,7 +560,7 @@
     private void buildRowLine()
     {
         StringBuffer rowLine = new StringBuffer();
-        rowLine.append( TABLE_ROW_START );
+        rowLine.append( TABLE_ROW_START_MARKUP );
 
         for ( int i = 0; i < cellCount; i++ )
         {
@@ -569,18 +569,18 @@
                 switch ( cellJustif[i] )
                 {
                 case 1:
-                    rowLine.append( TABLE_COL_LEFT_ALIGNED );
+                    rowLine.append( TABLE_COL_LEFT_ALIGNED_MARKUP );
                     break;
                 case 2:
-                    rowLine.append( TABLE_COL_RIGHT_ALIGNED );
+                    rowLine.append( TABLE_COL_RIGHT_ALIGNED_MARKUP );
                     break;
                 default:
-                    rowLine.append( TABLE_COL_CENTERED_ALIGNED );
+                    rowLine.append( TABLE_COL_CENTERED_ALIGNED_MARKUP );
                 }
             }
             else
             {
-                rowLine.append( TABLE_COL_CENTERED_ALIGNED );
+                rowLine.append( TABLE_COL_CENTERED_ALIGNED_MARKUP );
             }
         }
         rowLine.append( EOL );
@@ -609,7 +609,7 @@
     {
         if ( headerRow )
         {
-            buffer.append( TABLE_CELL_SEPARATOR );
+            buffer.append( TABLE_CELL_SEPARATOR_MARKUP );
         }
     }
 
@@ -628,7 +628,7 @@
     /** {@inheritDoc} */
     public void tableCell_( boolean headerRow )
     {
-        buffer.append( TABLE_CELL_SEPARATOR );
+        buffer.append( TABLE_CELL_SEPARATOR_MARKUP );
         cellCount++;
     }
 
@@ -660,13 +660,13 @@
     public void anchor( String name )
     {
 //        String id = HtmlTools.encodeId(name);
-        write( ANCHOR_START );
+        write( ANCHOR_START_MARKUP );
     }
 
     /** {@inheritDoc} */
     public void anchor_()
     {
-        write( ANCHOR_END );
+        write( ANCHOR_END_MARKUP );
     }
 
     /** {@inheritDoc} */
@@ -674,9 +674,9 @@
     {
         if ( !headerFlag )
         {
-            write( LINK_START_1 );
+            write( LINK_START_1_MARKUP );
             text( name );
-            write( LINK_START_2 );
+            write( LINK_START_2_MARKUP );
         }
     }
 
@@ -685,7 +685,7 @@
     {
         if ( !headerFlag )
         {
-            write( LINK_END );
+            write( LINK_END_MARKUP );
         }
     }
 
@@ -694,9 +694,9 @@
     {
         if ( !headerFlag )
         {
-            write( LINK_START_1 );
+            write( LINK_START_1_MARKUP );
             text( target );
-            write( LINK_START_2 );
+            write( LINK_START_2_MARKUP );
             text( name );
         }
     }
@@ -706,7 +706,7 @@
     {
         if ( !headerFlag )
         {
-            write( ITALIC_START );
+            write( ITALIC_START_MARKUP );
         }
     }
 
@@ -715,7 +715,7 @@
     {
         if ( !headerFlag )
         {
-            write( ITALIC_END );
+            write( ITALIC_END_MARKUP );
         }
     }
 
@@ -724,7 +724,7 @@
     {
         if ( !headerFlag )
         {
-            write( BOLD_START );
+            write( BOLD_START_MARKUP );
         }
     }
 
@@ -733,7 +733,7 @@
     {
         if ( !headerFlag )
         {
-            write( BOLD_END );
+            write( BOLD_END_MARKUP );
         }
     }
 
@@ -742,7 +742,7 @@
     {
         if ( !headerFlag )
         {
-            write( MONOSPACED_START );
+            write( MONOSPACED_START_MARKUP );
         }
     }
 
@@ -751,7 +751,7 @@
     {
         if ( !headerFlag )
         {
-            write( MONOSPACED_END );
+            write( MONOSPACED_END_MARKUP );
         }
     }
 
@@ -773,11 +773,11 @@
     {
         if ( headerFlag || bufferFlag )
         {
-            buffer.append( NON_BREAKING_SPACE );
+            buffer.append( NON_BREAKING_SPACE_MARKUP );
         }
         else
         {
-            write( NON_BREAKING_SPACE );
+            write( NON_BREAKING_SPACE_MARKUP );
         }
     }
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java?view=diff&rev=562687&r1=562686&r2=562687
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java Sat Aug  4 03:45:15 2007
@@ -21,6 +21,7 @@
 
 import java.io.Writer;
 
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.sink.AbstractSinkTest;
 import org.apache.maven.doxia.sink.Sink;
 import org.codehaus.plexus.util.StringUtils;
@@ -65,7 +66,8 @@
     /** {@inheritDoc} */
     protected String getHeadBlock()
     {
-        return AptMarkup.HEADER_START + AptMarkup.HEADER_START + AptMarkup.HEADER_START + AptMarkup.HEADER_START;
+        return AptMarkup.HEADER_START_MARKUP + AptMarkup.HEADER_START_MARKUP + AptMarkup.HEADER_START_MARKUP
+            + AptMarkup.HEADER_START_MARKUP;
     }
 
     /** {@inheritDoc} */
@@ -89,128 +91,128 @@
     /** {@inheritDoc} */
     protected String getSection2Block( String title )
     {
-        return AptMarkup.SECTION_TITLE_START + title;
+        return AptMarkup.SECTION_TITLE_START_MARKUP + title;
     }
 
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START ), 2 ) + title;
+        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 2 ) + title;
     }
 
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START ), 3 ) + title;
+        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 3 ) + title;
     }
 
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START ), 4 ) + title;
+        return StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 4 ) + title;
     }
 
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        return AptMarkup.SPACE_MARKUP + "" + AptMarkup.LIST_START + "" + AptMarkup.SPACE_MARKUP + item
-            + AptMarkup.SPACE_MARKUP + "" + AptMarkup.LIST_END;
+        return Markup.SPACE + "" + AptMarkup.LIST_START_MARKUP + "" + Markup.SPACE + item
+            + Markup.SPACE + "" + AptMarkup.LIST_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
-        return AptMarkup.SPACE_MARKUP + "" + AptMarkup.LEFT_SQUARE_BRACKET_MARKUP + ""
-            + AptMarkup.LEFT_SQUARE_BRACKET_MARKUP + AptMarkup.NUMBERING_LOWER_ROMAN_MARKUP + ""
-            + AptMarkup.RIGHT_SQUARE_BRACKET_MARKUP + "" + AptMarkup.RIGHT_SQUARE_BRACKET_MARKUP
-            + AptMarkup.SPACE_MARKUP + item + AptMarkup.SPACE_MARKUP + "" + AptMarkup.LIST_END;
+        return Markup.SPACE + "" + Markup.LEFT_SQUARE_BRACKET + ""
+            + Markup.LEFT_SQUARE_BRACKET + AptMarkup.NUMBERING_LOWER_ROMAN_CHAR + ""
+            + Markup.RIGHT_SQUARE_BRACKET + "" + Markup.RIGHT_SQUARE_BRACKET
+            + Markup.SPACE + item + Markup.SPACE + "" + AptMarkup.LIST_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        return AptMarkup.SPACE_MARKUP + "" + AptMarkup.LEFT_SQUARE_BRACKET_MARKUP + definum
-            + AptMarkup.RIGHT_SQUARE_BRACKET_MARKUP + "" + definition;
+        return Markup.SPACE + "" + Markup.LEFT_SQUARE_BRACKET + definum
+            + Markup.RIGHT_SQUARE_BRACKET + "" + definition;
     }
 
     /** {@inheritDoc} */
     protected String getFigureBlock( String source, String caption )
     {
-        return AptMarkup.LEFT_SQUARE_BRACKET_MARKUP + source + AptMarkup.RIGHT_SQUARE_BRACKET_MARKUP
-            + AptMarkup.SPACE_MARKUP + caption;
+        return Markup.LEFT_SQUARE_BRACKET + source + Markup.RIGHT_SQUARE_BRACKET
+            + Markup.SPACE + caption;
     }
 
     /** {@inheritDoc} */
     protected String getTableBlock( String cell, String caption )
     {
-        return AptMarkup.TABLE_ROW_START + AptMarkup.TABLE_COL_CENTERED_ALIGNED + cell
-        + AptMarkup.TABLE_ROW_SEPARATOR + AptMarkup.TABLE_ROW_START + AptMarkup.TABLE_COL_CENTERED_ALIGNED  + caption;
+        return AptMarkup.TABLE_ROW_START_MARKUP + AptMarkup.TABLE_COL_CENTERED_ALIGNED_MARKUP + cell
+        + AptMarkup.TABLE_ROW_SEPARATOR_MARKUP + AptMarkup.TABLE_ROW_START_MARKUP + AptMarkup.TABLE_COL_CENTERED_ALIGNED_MARKUP  + caption;
     }
 
     /** {@inheritDoc} */
     protected String getParagraphBlock( String text )
     {
-        return AptMarkup.SPACE_MARKUP + text;
+        return Markup.SPACE + text;
     }
 
     /** {@inheritDoc} */
     protected String getVerbatimBlock( String text )
     {
-        return "\n" + AptMarkup.BOXED_VERBATIM_START + "\n" + text + "\n" + AptMarkup.BOXED_VERBATIM_START + "\n";
+        return "\n" + AptMarkup.BOXED_VERBATIM_START_MARKUP + "\n" + text + "\n" + AptMarkup.BOXED_VERBATIM_START_MARKUP + "\n";
     }
 
     /** {@inheritDoc} */
     protected String getHorizontalRuleBlock()
     {
-        return AptMarkup.HORIZONTAL_RULE;
+        return AptMarkup.HORIZONTAL_RULE_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getPageBreakBlock()
     {
-        return AptMarkup.PAGE_BREAK;
+        return AptMarkup.PAGE_BREAK_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getAnchorBlock( String anchor )
     {
-        return AptMarkup.ANCHOR_START + anchor + AptMarkup.ANCHOR_END;
+        return AptMarkup.ANCHOR_START_MARKUP + anchor + AptMarkup.ANCHOR_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getLinkBlock( String link, String text )
     {
-        return AptMarkup.LINK_START_1 + link + AptMarkup.LINK_START_2 + text + AptMarkup.LINK_END;
+        return AptMarkup.LINK_START_1_MARKUP + link + AptMarkup.LINK_START_2_MARKUP + text + AptMarkup.LINK_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getItalicBlock( String text )
     {
-        return AptMarkup.ITALIC_START + text + AptMarkup.ITALIC_END;
+        return AptMarkup.ITALIC_START_MARKUP + text + AptMarkup.ITALIC_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getBoldBlock( String text )
     {
-        return AptMarkup.BOLD_START + text + AptMarkup.BOLD_END;
+        return AptMarkup.BOLD_START_MARKUP + text + AptMarkup.BOLD_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getMonospacedBlock( String text )
     {
-        return AptMarkup.MONOSPACED_START + text + AptMarkup.MONOSPACED_END;
+        return AptMarkup.MONOSPACED_START_MARKUP + text + AptMarkup.MONOSPACED_END_MARKUP;
     }
 
     /** {@inheritDoc} */
     protected String getLineBreakBlock()
     {
-        return AptMarkup.BACKSLASH_MARKUP + "";
+        return String.valueOf( AptMarkup.BACKSLASH );
     }
 
     /** {@inheritDoc} */
     protected String getNonBreakingSpaceBlock()
     {
-        return AptMarkup.NON_BREAKING_SPACE;
+        return AptMarkup.NON_BREAKING_SPACE_MARKUP;
     }
 
     /** {@inheritDoc} */
@@ -218,18 +220,18 @@
     {
         // "\\~, \\=, \\-, \\+, \\*, \\[, \\], \\<, \\>, \\{, \\}, \\\\"
         StringBuffer sb = new StringBuffer();
-        sb.append( getSpecialCharacters( AptMarkup.COMMENT_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.EQUAL_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.MINUS_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.PLUS_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.STAR_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.LEFT_SQUARE_BRACKET_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.RIGHT_SQUARE_BRACKET_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.LESS_THAN_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.GREATER_THAN_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.LEFT_CURLY_BRACKET_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.RIGHT_CURLY_BRACKET_MARKUP ) ).append( ", " );
-        sb.append( getSpecialCharacters( AptMarkup.BACKSLASH_MARKUP ) );
+        sb.append( getSpecialCharacters( AptMarkup.COMMENT ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.EQUAL ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.MINUS ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.PLUS ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.STAR ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.LEFT_SQUARE_BRACKET ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.RIGHT_SQUARE_BRACKET ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.LESS_THAN ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.GREATER_THAN ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.LEFT_CURLY_BRACKET ) ).append( ", " );
+        sb.append( getSpecialCharacters( Markup.RIGHT_CURLY_BRACKET ) ).append( ", " );
+        sb.append( getSpecialCharacters( AptMarkup.BACKSLASH ) );
 
         return sb.toString();
     }
@@ -248,6 +250,6 @@
      */
     private static String getSpecialCharacters( char c )
     {
-        return AptMarkup.BACKSLASH_MARKUP + "" + c;
+        return AptMarkup.BACKSLASH + "" + c;
     }
 }



Mime
View raw message