svn commit: r397652 - /maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java
Author: carlos Date: Thu Apr 27 14:52:47 2006 New Revision: 397652 URL: http://svn.apache.org/viewcvs?rev=397652&view=rev Log: Fix small javadoc problems Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java?rev=397652&r1=397651&r2=397652&view=diff == --- maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java (original) +++ maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java Thu Apr 27 14:52:47 2006 @@ -1,5 +1,7 @@ -package org.apache.maven.doxia.util;/* - * Copyright 2004-2005 The Apache Software Foundation. +package org.apache.maven.doxia.util; + +/* + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -164,7 +166,6 @@ */ public static String[] removeAt( String[] strings, int index ) { -String string = strings[index]; String[] newStrings = new String[strings.length - 1]; if ( index > 0 ) @@ -185,7 +186,7 @@ // --- /** - * Like [EMAIL PROTECTED] #escape} but puts a double quote character ('\"') + * Like [EMAIL PROTECTED] #escape(String)} but puts a double quote character ('\"') * around the escaped string. */ public static String protect( String string ) @@ -282,7 +283,7 @@ } /** - * Like [EMAIL PROTECTED] #unescape} but removes the double quote characters + * Like [EMAIL PROTECTED] #unescape(String)} but removes the double quote characters * ('\"'), if any, before unescaping the string. */ public static String unprotect( String string ) @@ -394,7 +395,7 @@ } /** - * A simple test for [EMAIL PROTECTED] #escape} and [EMAIL PROTECTED] #unescape}. + * A simple test for [EMAIL PROTECTED] #escape(String)} and [EMAIL PROTECTED] #unescape(String)}. */ public static final void main( String[] args ) { @@ -573,7 +574,7 @@ * @param oldSub the substring to replace * @param newSub the replacement substring * @return a string where all replacements have been performed - * @see String#replace + * @see String#replaceAll(String, String) */ public static String replaceAll( String string, String oldSub, String newSub ) { @@ -604,9 +605,9 @@ */ /* public static final void main(String[] args) { - System.out.println("'" + - StringUtil.replaceAll(args[0], args[1], args[2]) + - "'"); +System.out.println("'" + + StringUtil.replaceAll(args[0], args[1], args[2]) + + "'"); } */ }
svn commit: r397653 - /maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java
Author: carlos Date: Thu Apr 27 14:53:12 2006 New Revision: 397653 URL: http://svn.apache.org/viewcvs?rev=397653&view=rev Log: Format Modified: maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java Modified: maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java?rev=397653&r1=397652&r2=397653&view=diff == --- maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java (original) +++ maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/rtf/RtfSinkTest.java Thu Apr 27 14:53:12 2006 @@ -1,7 +1,7 @@ package org.apache.maven.doxia.module.rtf; /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ throws Exception { File outputFile = new File( getBasedirFile(), "target/output/test.rtf" ); - outputFile.getParentFile().mkdirs(); +outputFile.getParentFile().mkdirs(); return new RtfSink( new FileOutputStream( outputFile ) ); } }
svn commit: r397655 - /maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java
Author: carlos Date: Thu Apr 27 14:59:40 2006 New Revision: 397655 URL: http://svn.apache.org/viewcvs?rev=397655&view=rev Log: Minor reformat Modified: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java Modified: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java?rev=397655&r1=397654&r2=397655&view=diff == --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java (original) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java Thu Apr 27 14:59:40 2006 @@ -1,7 +1,7 @@ package org.apache.maven.doxia.module.confluence; /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,10 +64,9 @@ }; } -//TODO: -// (empty line) Produces a new paragraph -// \\ Creates a line break. Not often needed, most of the time Confluence will guess new lines for you appropriately. -// better support for anchors +//TODO: (empty line) Produces a new paragraph +//TODO: \\ Creates a line break. Not often needed, most of the time Confluence will guess new lines for you appropriately. +//TODO: better support for anchors public List parse( ByLineSource source ) throws ParseException
svn commit: r397676 - in /maven/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/macro/ doxia-core/src/main/java/org/apache/maven/doxia/module/apt/ doxia-core/src/main/java/org/apache/mave
Author: carlos Date: Thu Apr 27 16:20:29 2006 New Revision: 397676 URL: http://svn.apache.org/viewcvs?rev=397676&view=rev Log: [DOXIA-59] Doxia creates files with inconsistent new lines. Use system line separator instead of \n Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xhtml/SinkDescriptorReader.java maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java maven/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java maven/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java?rev=397676&r1=397675&r2=397676&view=diff == --- maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java (original) +++ maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java Thu Apr 27 16:20:29 2006 @@ -1,7 +1,7 @@ package org.apache.maven.doxia.macro; /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,17 +27,19 @@ public class EchoMacro extends AbstractMacro { +private static final String EOL = System.getProperty( "line.separator" ); + public void execute( Sink sink, MacroRequest request ) { sink.verbatim( true ); -sink.text( "echo\n" ); +sink.text( "echo" + EOL ); for ( Iterator i = request.getParameters().keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); -sink.text( key + " ---> " + request.getParameter( key ) + "\n" ); +sink.text( key + " ---> " + request.getParameter( key ) + EOL ); } sink.verbatim_(); Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?rev=397676&r1=397675&r2=397676&view=diff == --- maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java (original) +++ maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Thu Apr 27 16:20:29 2006 @@ -1,7 +1,7 @@ package org.apache.maven.doxia.module.apt; /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,8 @@ public class AptParser extends AbstractParser { +private static final String EOL = System.getProperty( "line.separator" ); + private static final int TITLE = 0; private static final int SECTION1 = 1; @@ -1279,7 +1281,7 @@ break; } -buffer.append( '\n' ); +buffer.append( EOL ); buffer.append( l ); AptParser.this.nextLine(); @@ -1383,7 +1385,7 @@ public void traverse() throws AptParseException { -StringTokenizer lines = new StringTokenizer( text, "\n" ); +StringTokenizer lines = new StringTokenizer( text, EOL ); int separator = -1; boolean firstLine = true; boolean title = false; @@ -1684,7 +1686,7 @@ buffer.append( c );
svn commit: r398035 - /maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
Author: carlos Date: Fri Apr 28 16:24:40 2006 New Revision: 398035 URL: http://svn.apache.org/viewcvs?rev=398035&view=rev Log: Added docs and method getSink() Modified: maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java Modified: maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java?rev=398035&r1=398034&r2=398035&view=diff == --- maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java (original) +++ maven/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java Fri Apr 28 16:24:40 2006 @@ -1,7 +1,7 @@ package org.apache.maven.doxia.parser; /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,23 +24,50 @@ import java.io.Reader; /** + * Test the parsing of sample input files + * + * @author mailto:[EMAIL PROTECTED]">Carlos Sanchez * @author mailto:[EMAIL PROTECTED]">Emmanuel Venisse * @version $Id:AbstractParserTestCase.java 348605 2005-11-24 12:02:44 +1100 (Thu, 24 Nov 2005) brett $ */ public abstract class AbstractParserTestCase extends PlexusTestCase { +/** + * Parser to use to convert input to sink events + * + * @return the parser to use + */ protected abstract Parser getParser(); +/** + * Path of the document to test, relative to basedir + * + * @return the relative path + */ protected abstract String getDocument(); + +/** + * Sink to write the output of the parsing + * + * @return a SinkAdapter if not overridden + */ +protected Sink getSink() +{ +return new SinkAdapter(); +} +/** + * Parse the document in the path specified by [EMAIL PROTECTED] #getDocument()}, + * with parser from [EMAIL PROTECTED] #getParser()}, and output to sink from [EMAIL PROTECTED] #getSink()} + * + * @throws Exception + */ public void testParser() throws Exception { -Sink sink = new SinkAdapter(); - Reader reader = new FileReader( getTestFile( getBasedir(), getDocument() ) ); -getParser().parse( reader, sink ); +getParser().parse( reader, getSink() ); } }
svn commit: r398037 - /maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java
Author: carlos Date: Fri Apr 28 16:26:14 2006 New Revision: 398037 URL: http://svn.apache.org/viewcvs?rev=398037&view=rev Log: Added javadoc Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java?rev=398037&r1=398036&r2=398037&view=diff == --- maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java (original) +++ maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java Fri Apr 28 16:26:14 2006 @@ -1,5 +1,7 @@ -package org.apache.maven.doxia.sink;/* - * Copyright 2004-2005 The Apache Software Foundation. +package org.apache.maven.doxia.sink; + +/* + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +16,12 @@ * limitations under the License. */ +/** + * Empty implementation of the Sink interface. Useful for testing purposes. + */ public class SinkAdapter implements Sink { -// Not abstract. Useful just to apt a document without converting it. - public void head() { }
svn commit: r398038 - /maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java
Author: carlos Date: Fri Apr 28 16:32:29 2006 New Revision: 398038 URL: http://svn.apache.org/viewcvs?rev=398038&view=rev Log: [DOXIA-59] Doxia creates files with inconsistent new lines. Use system line separator instead of \n Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java Modified: maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java?rev=398038&r1=398037&r2=398038&view=diff == --- maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java (original) +++ maven/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java Fri Apr 28 16:32:29 2006 @@ -26,6 +26,8 @@ { public static final int DEFAULT_MAX_LINE_LENGTH = 78; +private static final String EOL = System.getProperty( "line.separator" ); + private Writer destination; private BufferedWriter writer; @@ -88,7 +90,7 @@ case '\n': writeWord(); -writer.write( '\n' ); +writer.write( EOL ); lineLength = 0; break; @@ -126,7 +128,7 @@ { if ( lineLength + 1 + length > maxLineLength ) { -writer.write( '\n' ); +writer.write( EOL ); lineLength = 0; } else
svn commit: r472301 - /maven/doxia/trunk/pom.xml
Author: carlos Date: Tue Nov 7 14:16:26 2006 New Revision: 472301 URL: http://svn.apache.org/viewvc?view=rev&rev=472301 Log: Update parent Modified: maven/doxia/trunk/pom.xml Modified: maven/doxia/trunk/pom.xml URL: http://svn.apache.org/viewvc/maven/doxia/trunk/pom.xml?view=diff&rev=472301&r1=472300&r2=472301 == --- maven/doxia/trunk/pom.xml (original) +++ maven/doxia/trunk/pom.xml Tue Nov 7 14:16:26 2006 @@ -23,7 +23,7 @@ org.apache.maven maven-parent -1 +4 ../pom/maven/pom.xml org.apache.maven.doxia