From doxia-commitsbrittany35@example.net Mon Feb 06 21:56:23 2006 Return-Path: <doxia-commitsbrittany35@example.net> Delivered-To: brittany35@example.net Received: (qmail 44171 invoked from network); 6 Feb 2006 21:56:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Feb 2006 21:56:22 -0000 Received: (qmail 4502 invoked by uid 500); 6 Feb 2006 21:56:22 -0000 Delivered-To: brittany35@example.net Received: (qmail 4479 invoked by uid 500); 6 Feb 2006 21:56:22 -0000 Mailing-List: contact brittany35@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:brittany35@example.net> List-Unsubscribe: <mailto:brittany35@example.net> List-Post: <mailto:brittany35@example.net> List-Id: <doxia-commits.maven.apache.org> Reply-To: brittany35@example.net Delivered-To: mailing list brittany35@example.net Received: (qmail 4470 invoked by uid 99); 6 Feb 2006 21:56:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 13:56:21 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Feb 2006 13:56:21 -0800 Received: (qmail 44091 invoked by uid 65534); 6 Feb 2006 21:56:01 -0000 Message-ID: <brittany35@example.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r375392 - in /maven/doxia/trunk: doxia-module-twiki/ doxia-modules/ doxia-modules/doxia-module-twiki/ Date: Mon, 06 Feb 2006 21:56:00 -0000 To: brittany35@example.net From: brittany35@example.net X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jvanzyl Date: Mon Feb 6 13:55:59 2006 New Revision: 375392 URL: http://svn.apache.org/viewcvs?rev=375392&view=rev Log: [DOXIA-45] moving the twiki module Added: maven/doxia/trunk/doxia-modules/ maven/doxia/trunk/doxia-modules/doxia-module-twiki/ - copied from r368739, maven/doxia/trunk/doxia-module-twiki/ Removed: maven/doxia/trunk/doxia-module-twiki/ From doxia-commitsbrittany35@example.net Mon Feb 06 22:33:08 2006 Return-Path: <doxia-commitsbrittany35@example.net> Delivered-To: brittany35@example.net Received: (qmail 58751 invoked from network); 6 Feb 2006 22:33:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Feb 2006 22:33:07 -0000 Received: (qmail 43911 invoked by uid 500); 6 Feb 2006 22:33:07 -0000 Delivered-To: brittany35@example.net Received: (qmail 43889 invoked by uid 500); 6 Feb 2006 22:33:07 -0000 Mailing-List: contact brittany35@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:brittany35@example.net> List-Unsubscribe: <mailto:brittany35@example.net> List-Post: <mailto:brittany35@example.net> List-Id: <doxia-commits.maven.apache.org> Reply-To: brittany35@example.net Delivered-To: mailing list brittany35@example.net Received: (qmail 43878 invoked by uid 99); 6 Feb 2006 22:33:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 14:33:07 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Feb 2006 14:33:05 -0800 Received: (qmail 58638 invoked by uid 65534); 6 Feb 2006 22:32:43 -0000 Message-ID: <brittany35@example.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r375400 [2/2] - in /maven/doxia/trunk/doxia-modules: doxia-module-confluence/ doxia-module-confluence/src/ doxia-module-confluence/src/main/ doxia-module-confluence/src/main/java/ doxia-module-confluence/src/main/java/org/ doxia-module-conf... Date: Mon, 06 Feb 2006 22:31:59 -0000 To: brittany35@example.net From: brittany35@example.net X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,103 @@ +package org.apache.maven.doxia.module.confluence.parser.table; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.module.confluence.parser.BlockParser; +import org.apache.maven.doxia.module.confluence.parser.Block; +import org.apache.maven.doxia.module.confluence.parser.BoldBlock; +import org.apache.maven.doxia.module.confluence.parser.TextBlock; +import org.apache.maven.doxia.parser.ParseException; +import org.codehaus.plexus.util.StringUtils; + + +/** + * Parse tables + * + * @author Juan F. Codagnone + * @since Nov 9, 2005 + */ +public class TableBlockParser + implements BlockParser +{ + public boolean accept( String line, ByLineSource source ) + { + return line.startsWith( "|" ); + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + if ( !accept( line, source ) ) + { + throw new IllegalAccessError( "call accept before this ;)" ); + } + + List rows = new ArrayList(); + + String l = line; + + do + { + List cells = new ArrayList(); + + if ( l.startsWith( "||" ) ) + { + String[] text = StringUtils.split( l, "||" ); + + + for ( int i = 0; i < text.length; i++ ) + { + List textBlocks = new ArrayList(); + + textBlocks.add( new TextBlock( text[i] ) ); + + List blocks = new ArrayList(); + + blocks.add( new BoldBlock( textBlocks ) ); + + cells.add( new TableCellHeaderBlock( blocks ) ); + } + } + else + { + String[] text = StringUtils.split( l, "|" ); + + + for ( int i = 0; i < text.length; i++ ) + { + List blocks = new ArrayList(); + + blocks.add( new TextBlock( text[i] ) ); + + cells.add( new TableCellBlock( blocks ) ); + } + } + + rows.add( new TableRowBlock( cells ) ); + } + + while ( ( l = source.getNextLine() ) != null && accept( l, source ) ); + + assert rows.size() >= 1; + + return new TableBlock( rows ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,41 @@ +/* + * Copyright 2005 Zauber <info /at/ zauber dot com dot ar> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.maven.doxia.module.confluence.parser.table; + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + + +public class TableCellBlock + extends AbstractFatherBlock +{ + public TableCellBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.tableCell(); + } + + public void after( Sink sink ) + { + sink.tableCell_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,40 @@ +/* + * Copyright 2005 Zauber <info /at/ zauber dot com dot ar> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.maven.doxia.module.confluence.parser.table; + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class TableCellHeaderBlock + extends AbstractFatherBlock +{ + public TableCellHeaderBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.tableHeaderCell(); + } + + public void after( Sink sink ) + { + sink.tableHeaderCell_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,27 @@ +package org.apache.maven.doxia.module.confluence.parser.table; + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + + +public class TableRowBlock + extends AbstractFatherBlock +{ + public TableRowBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.tableRow(); + } + + public void after( Sink sink ) + { + sink.tableRow_(); + } + +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Modified: maven/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml?rev=375400&r1=375399&r2=375400&view=diff ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml (original) +++ maven/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml Mon Feb 6 14:31:55 2006 @@ -3,11 +3,11 @@ <parent> <artifactId>doxia</artifactId> <groupId>org.apache.maven.doxia</groupId> - <version>1.0-alpha-6-SNAPSHOT</version> + <version>1.0-alpha-8-SNAPSHOT</version> </parent> <artifactId>doxia-module-twiki</artifactId> <name>Doxia TWiki sink</name> - <version>1.0-alpha-6-SNAPSHOT</version> + <version>1.0-alpha-8-SNAPSHOT</version> <developers> <developer> <name>Juan F. Codagnone</name> @@ -22,7 +22,7 @@ <dependency> <groupId>org.apache.maven.doxia</groupId> <artifactId>doxia-core</artifactId> - <version>1.0-alpha-6-SNAPSHOT</version> + <version>1.0-alpha-8-SNAPSHOT</version> </dependency> <dependency> <groupId>junit</groupId> @@ -37,8 +37,8 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> - <source>1.5</source> - <target>1.5</target> + <source>1.4</source> + <target>1.4</target> </configuration> </plugin> </plugins> From doxia-commitsbrittany35@example.net Mon Feb 06 22:33:14 2006 Return-Path: <doxia-commitsbrittany35@example.net> Delivered-To: brittany35@example.net Received: (qmail 58797 invoked from network); 6 Feb 2006 22:33:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Feb 2006 22:33:13 -0000 Received: (qmail 44019 invoked by uid 500); 6 Feb 2006 22:33:09 -0000 Delivered-To: brittany35@example.net Received: (qmail 43995 invoked by uid 500); 6 Feb 2006 22:33:09 -0000 Mailing-List: contact brittany35@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:brittany35@example.net> List-Unsubscribe: <mailto:brittany35@example.net> List-Post: <mailto:brittany35@example.net> List-Id: <doxia-commits.maven.apache.org> Reply-To: brittany35@example.net Delivered-To: mailing list brittany35@example.net Received: (qmail 43986 invoked by uid 99); 6 Feb 2006 22:33:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 14:33:08 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Feb 2006 14:33:05 -0800 Received: (qmail 58635 invoked by uid 65534); 6 Feb 2006 22:32:43 -0000 Message-ID: <brittany35@example.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r375400 [1/2] - in /maven/doxia/trunk/doxia-modules: doxia-module-confluence/ doxia-module-confluence/src/ doxia-module-confluence/src/main/ doxia-module-confluence/src/main/java/ doxia-module-confluence/src/main/java/org/ doxia-module-conf... Date: Mon, 06 Feb 2006 22:31:59 -0000 To: brittany35@example.net From: brittany35@example.net X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jvanzyl Date: Mon Feb 6 14:31:55 2006 New Revision: 375400 URL: http://svn.apache.org/viewcvs?rev=375400&view=rev Log: o adding confluence module Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java (with props) maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java (with props) Modified: maven/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml Mon Feb 6 14:31:55 2006 @@ -0,0 +1,53 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>doxia-modules</artifactId> + <groupId>org.apache.maven.doxia</groupId> + <version>1.0-alpha-8-SNAPSHOT</version> + </parent> + <artifactId>doxia-module-confluence</artifactId> + <name>Doxia TWiki sink</name> + <version>1.0-alpha-8-SNAPSHOT</version> + <developers> + <developer> + <name>Juan F. Codagnone</name> + <email>juan *at* zauber dot. com dot. ar</email> + <roles> + <role>Developer</role> + </roles> + <timezone>-3</timezone> + </developer> + <developer> + <name>Jason van Zyl</name> + <roles> + <role>Developer</role> + </roles> + <timezone>-5</timezone> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-core</artifactId> + <version>1.0-alpha-8-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + </plugins> + </build> +</project> Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: 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=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,155 @@ +package org.apache.maven.doxia.module.confluence; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.module.common.ByLineReaderSource; +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.module.confluence.parser.Block; +import org.apache.maven.doxia.module.confluence.parser.BlockParser; +import org.apache.maven.doxia.module.confluence.parser.SectionBlockParser; +import org.apache.maven.doxia.module.confluence.parser.ParagraphBlockParser; +import org.apache.maven.doxia.module.confluence.parser.VerbatimBlockParser; +import org.apache.maven.doxia.module.confluence.parser.HorizontalRuleBlockParser; +import org.apache.maven.doxia.module.confluence.parser.table.TableBlockParser; +import org.apache.maven.doxia.module.confluence.parser.list.ListBlockParser; +import org.apache.maven.doxia.parser.AbstractParser; +import org.apache.maven.doxia.parser.ParseException; +import org.apache.maven.doxia.sink.Sink; + +import java.io.Reader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * @plexus.component role="org.apache.maven.doxia.parser.Parser" + * role-hint="confluence" + */ +public class ConfluenceParser + extends AbstractParser +{ + private BlockParser[] parsers; + + public ConfluenceParser() + { + BlockParser headingParser = new SectionBlockParser(); + BlockParser verbatimParser = new VerbatimBlockParser(); + BlockParser horizontalRuleParser = new HorizontalRuleBlockParser(); + BlockParser paragraphParser = new ParagraphBlockParser(); + BlockParser listParser = new ListBlockParser(); + BlockParser tableParser = new TableBlockParser(); + + parsers = new BlockParser[] + { + headingParser, + verbatimParser, + horizontalRuleParser, + listParser, + tableParser, + paragraphParser + }; + } + + //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 + + public List parse( ByLineSource source ) + throws ParseException + { + List blocks = new ArrayList(); + + String line; + + while ( ( line = source.getNextLine() ) != null ) + { + boolean accepted = false; + + for ( int i = 0; i < parsers.length; i++ ) + { + BlockParser parser = parsers[i]; + + if ( line.trim().length() == 0 ) + { + continue; + } + + if ( parser.accept( line, source ) ) + { + /* + System.out.println( "------------------------------------------------------------" ); + System.out.println( "line = " + line ); + System.out.println( "line accepted by: " + parser ); + System.out.println( "------------------------------------------------------------" ); + */ + + accepted = true; + + blocks.add( parser.visit( line, source ) ); + + break; + } + } + + /* + if ( !accepted ) + { + throw new ParseException( "don't know how to handle line: " + source.getLineNumber() + ": " + line ); + } + */ + } + + return blocks; + } + + public synchronized void parse( Reader reader, Sink sink ) + throws ParseException + { + List blocks; + + ByLineSource source = new ByLineReaderSource( reader ); + + try + { + blocks = parse( source ); + } + catch ( ParseException e ) + { + throw e; + } + catch ( Exception e ) + { + throw new ParseException( e, source.getName(), source.getLineNumber() ); + } + + sink.head(); + + sink.head_(); + + sink.body(); + + for ( Iterator i = blocks.iterator(); i.hasNext(); ) + { + Block block = (Block) i.next(); + + block.traverse( sink ); + } + + sink.body_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,44 @@ +package org.apache.maven.doxia.module.confluence; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.site.module.AbstractSiteModule; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id:AptSiteModule.java 348605 2005-11-24 12:02:44 +1100 (Thu, 24 Nov 2005) brett $ + * @plexus.component role="org.apache.maven.doxia.site.module.SiteModule" + * role-hint="confluence" + */ +public class ConfluenceSiteModule + extends AbstractSiteModule +{ + public String getSourceDirectory() + { + return "confluence"; + } + + public String getExtension() + { + return "confluence"; + } + + public String getParserId() + { + return "confluence"; + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSiteModule.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,62 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.Arrays; +import java.util.List; +import java.util.Iterator; + +import org.apache.maven.doxia.sink.Sink; + +public abstract class AbstractFatherBlock + implements Block +{ + private List blocks; + + public abstract void before( Sink sink ); + + public abstract void after( Sink sink ); + + public AbstractFatherBlock( List childBlocks ) + { + if ( childBlocks == null ) + { + throw new IllegalArgumentException( "argument can't be null" ); + } + + this.blocks = childBlocks; + } + + public void traverse( Sink sink ) + { + before( sink ); + + for ( Iterator i = blocks.iterator(); i.hasNext(); ) + { + Block block = (Block) i.next(); + + block.traverse( sink ); + } + + after( sink ); + } + + public List getBlocks() + { + return blocks; + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,40 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +public class AnchorBlock + implements Block +{ + private String name; + + public AnchorBlock( String name ) throws IllegalArgumentException + { + if ( name == null ) + { + throw new IllegalArgumentException( "argument can't be null" ); + } + this.name = name; + } + + public void traverse( Sink sink ) + { + sink.anchor( name ); + sink.anchor_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AnchorBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,24 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +public interface Block +{ + void traverse( Sink sink ); +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/Block.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,28 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.module.confluence.parser.Block; +import org.apache.maven.doxia.parser.ParseException; + +public interface BlockParser +{ + boolean accept( String line, ByLineSource source ); + + Block visit( String line, ByLineSource source ) throws ParseException; +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,40 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class BoldBlock + extends AbstractFatherBlock +{ + public BoldBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.bold(); + } + + public void after( Sink sink ) + { + sink.bold_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,28 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +public class HorizontalRuleBlock + implements Block +{ + public void traverse( Sink sink ) + { + sink.horizontalRule(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,35 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.parser.ParseException; + +public class HorizontalRuleBlockParser + implements BlockParser +{ + public boolean accept( String line, ByLineSource source ) + { + return line.startsWith( "----" ); + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + return new HorizontalRuleBlock(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/HorizontalRuleBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,40 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class ItalicBlock + extends AbstractFatherBlock +{ + public ItalicBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.italic(); + } + + public void after( Sink sink ) + { + sink.italic_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,48 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + + +public class LinkBlock + implements Block +{ + private String reference; + + private String text; + + public LinkBlock( String reference, String text ) + throws IllegalArgumentException + { + if ( reference == null || text == null ) + { + throw new IllegalArgumentException( "arguments can't be null" ); + } + this.reference = reference; + this.text = text; + } + + public void traverse( Sink sink ) + { + sink.link( reference ); + + sink.text( text ); + + sink.link_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/LinkBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,39 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class MonospaceBlock extends AbstractFatherBlock +{ + public MonospaceBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.monospaced(); + } + + public void after( Sink sink ) + { + sink.monospaced_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,45 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +/** + * @author Juan F. Codagnone + * @since Nov 1, 2005 + */ +public class ParagraphBlock + extends AbstractFatherBlock +{ + public ParagraphBlock( List blocks ) + throws IllegalArgumentException + { + super( blocks ); + } + + public void before( Sink sink ) + { + sink.paragraph(); + } + + public void after( Sink sink ) + { + sink.paragraph_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,167 @@ +package org.apache.maven.doxia.module.confluence.parser; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.ArrayList; +import java.util.List; +import java.util.Arrays; + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.parser.ParseException; +import org.codehaus.plexus.util.StringUtils; + +public class ParagraphBlockParser + implements BlockParser +{ + public boolean accept( String line, ByLineSource source ) + { + return true; + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + boolean insideBold = false; + boolean insideItalic = false; + boolean insideLink = false; + + List blocks = new ArrayList(); + + StringBuffer text = new StringBuffer(); + + do + { + if ( line.trim().length() == 0 ) + { + break; + } + + for ( int i = 0; i < line.length(); i++ ) + { + char c = line.charAt( i ); + + switch ( c ) + { + case '*': + if ( insideBold ) + { + TextBlock tb = new TextBlock( text.toString() ); + blocks.add( new BoldBlock( Arrays.asList( new Block[]{tb} ) ) ); + text = new StringBuffer(); + } + else + { + blocks.add( new TextBlock( text.toString() ) ); + text = new StringBuffer(); + insideBold = true; + } + + break; + case '_': + if ( insideItalic ) + { + TextBlock tb = new TextBlock( text.toString() ); + blocks.add( new ItalicBlock( Arrays.asList( new Block[]{tb} ) ) ); + text = new StringBuffer(); + } + else + { + blocks.add( new TextBlock( text.toString() ) ); + text = new StringBuffer(); + insideItalic = true; + } + + break; + case '[': + insideLink = true; + blocks.add( new TextBlock( text.toString() ) ); + text = new StringBuffer(); + break; + case ']': + if ( insideLink ) + { + String link = text.toString(); + + if ( link.indexOf( "|" ) > 0 ) + { + String[] pieces = StringUtils.split( text.toString(), "|" ); + blocks.add( new LinkBlock( pieces[1], pieces[0] ) ); + } + else + { + blocks.add( new LinkBlock( link, link ) ); + } + + text = new StringBuffer(); + } + + break; + case '{': + + if ( line.charAt( i + 1 ) == '{' ) + { + i++; + blocks.add( new TextBlock( text.toString() ) ); + text = new StringBuffer(); + } + else + { + text.append( c ); + } + + break; + case '}': + + System.out.println( "line = " + line ); + + if ( line.charAt( i + 1 ) == '}' ) + { + i++; + TextBlock tb = new TextBlock( text.toString() ); + blocks.add( new MonospaceBlock( Arrays.asList( new Block[]{tb} ) ) ); + text = new StringBuffer(); + } + else + { + text.append( c ); + } + + break; + default: + text.append( c ); + } + } + } + // TODO: instead of just flying along we should probably test new lines in the other parsers + // to make sure there aren't things that should be handled by other parsers. For example, right + // now: + // Blah blah blah blah + // # one + // # two + // + // Will not get processed correctly. This parser will try to deal with it when it should be handled + // by the list parser. + while ( ( line = source.getNextLine() ) != null ); + + if ( text.length() > 0 ) + { + blocks.add( new TextBlock( text.toString() ) ); + } + + return new ParagraphBlock( blocks ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,79 @@ +package org.apache.maven.doxia.module.confluence.parser; + +import org.apache.maven.doxia.sink.Sink; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class SectionBlock + implements Block +{ + private String title; + + private int level; + + public SectionBlock( String title, int level ) + { + this.title = title; + this.level = level; + } + + public void traverse( Sink sink ) + { + if ( level == 1 ) + { + sink.section1(); + sink.sectionTitle1(); + } + else if ( level == 2 ) + { + sink.section2(); + sink.sectionTitle2(); + } + else if ( level == 3 ) + { + sink.section3(); + sink.sectionTitle3(); + } + else if ( level == 4 ) + { + sink.section4(); + sink.sectionTitle4(); + } + else if ( level == 5 ) + { + sink.section5(); + sink.sectionTitle5(); + } + + sink.text( title ); + + if ( level == 1 ) + { + sink.section1_(); + sink.sectionTitle1_(); + } + else if ( level == 2 ) + { + sink.section2_(); + sink.sectionTitle2_(); + } + else if ( level == 3 ) + { + sink.section3_(); + sink.sectionTitle3_(); + + } + else if ( level == 4 ) + { + sink.section4_(); + sink.sectionTitle4_(); + } + else if ( level == 5 ) + { + sink.section5_(); + sink.sectionTitle5_(); + } + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2005 Your Corporation. All Rights Reserved. + */ +package org.apache.maven.doxia.module.confluence.parser; + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.parser.ParseException; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class SectionBlockParser + implements BlockParser +{ + public boolean accept( String line, ByLineSource source ) + { + if ( line.startsWith( "h1." ) ) + { + return true; + } + else if ( line.startsWith( "h2." ) ) + { + return true; + } + else if ( line.startsWith( "h3." ) ) + { + return true; + } + else if ( line.startsWith( "h4." ) ) + { + return true; + } + else if ( line.startsWith( "h5." ) ) + { + return true; + } + + return false; + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + int level = Integer.parseInt( Character.toString( line.charAt( 1 ) ) ); + + String title = line.substring( 3 ); + + return new SectionBlock( title, level ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/SectionBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2005 Your Corporation. All Rights Reserved. + */ +package org.apache.maven.doxia.module.confluence.parser; + +import org.apache.maven.doxia.sink.Sink; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class TextBlock + implements Block +{ + private String text; + + public TextBlock( String text ) + { + this.text = text; + } + + public void traverse( Sink sink ) + { + sink.text( text ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/TextBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2005 Your Corporation. All Rights Reserved. + */ +package org.apache.maven.doxia.module.confluence.parser; + +import org.apache.maven.doxia.sink.Sink; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class VerbatimBlock + implements Block +{ + private String text; + + public VerbatimBlock( String text ) + { + this.text = text; + } + + public void traverse( Sink sink ) + { + sink.verbatim( true ); + + sink.text( text ); + + sink.verbatim_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2005 Your Corporation. All Rights Reserved. + */ +package org.apache.maven.doxia.module.confluence.parser; + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.parser.ParseException; + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class VerbatimBlockParser + implements BlockParser +{ + static String LS = System.getProperty( "line.separator" ); + + public boolean accept( String line, ByLineSource source ) + { + if ( line.startsWith( "{code}" ) || line.startsWith( "{noformat}" ) ) + { + return true; + } + + return false; + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + StringBuffer text = new StringBuffer(); + + while ( ( line = source.getNextLine() ) != null ) + { + if ( line.startsWith( "{code}" ) || line.startsWith( "{noformat}" ) ) + { + break; + } + + // TODO + text.append( line ).append( LS ); + } + + return new VerbatimBlock( text.toString() ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/VerbatimBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,43 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +import org.apache.maven.doxia.sink.Sink; +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; + +import java.util.List;/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class BulletedListBlock + extends ListBlock +{ + public BulletedListBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.list(); + } + + public void after( Sink sink ) + { + sink.list_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,32 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; + +import java.util.List;/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public abstract class ListBlock + extends AbstractFatherBlock +{ + protected ListBlock( List childBlocks ) + { + super( childBlocks ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,113 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +import org.apache.maven.doxia.module.common.ByLineSource; +import org.apache.maven.doxia.module.confluence.parser.Block; +import org.apache.maven.doxia.module.confluence.parser.BlockParser; +import org.apache.maven.doxia.parser.ParseException; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author <a href="mailto:brittany35@example.net">Jason van Zyl</a> + * @version $Id$ + */ +public class ListBlockParser + implements BlockParser +{ + public static int BULLETED_LIST = 0; + + public static int NUMBERED_LIST = 1; + + public boolean accept( String line, ByLineSource source ) + { + String nextLine = null; + + try + { + nextLine = source.getNextLine(); + + source.ungetLine(); + } + catch ( ParseException e ) + { + // do nothing + } + + if ( isList( line ) && isList( nextLine ) ) + { + return true; + } + + return false; + } + + public Block visit( String line, ByLineSource source ) + throws ParseException + { + TreeListBuilder treeListBuilder = new TreeListBuilder(); + + String l = line; + + do + { + if ( !isList( l ) ) + { + break; + } + + if ( isBulletedList( l ) ) + { + int level = getLevel( l, '*' ); + + treeListBuilder.feedEntry( BULLETED_LIST, level, l.substring( level ) ); + } + else + { + int level = getLevel( l, '#' ); + + treeListBuilder.feedEntry( NUMBERED_LIST, level, l.substring( level ) ); + } + } + while ( ( l = source.getNextLine() ) != null ); + + return treeListBuilder.getBlock(); + } + + private int getLevel( String line, char c ) + { + int level = 0; + + while ( line.charAt( level ) == c ) + { + level++; + } + + return level; + } + + private boolean isBulletedList( String line ) + { + return ( line.startsWith( "*" ) || line.startsWith( "-" ) ); + } + + private boolean isList( String line ) + { + line = line.trim(); + + return ( line.startsWith( "*" ) || line.startsWith( "-" ) || line.startsWith( "#" ) ); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,62 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class ListItemBlock + extends AbstractFatherBlock +{ + private ListBlock innerList; + + public ListItemBlock( List blocks ) + throws IllegalArgumentException + { + this( blocks, null ); + } + + public ListItemBlock( List blocks, ListBlock innerList ) + throws IllegalArgumentException + { + super( blocks ); + + this.innerList = innerList; + } + + public void before( Sink sink ) + { + sink.listItem(); + } + + public void after( Sink sink ) + { + if ( innerList != null ) + { + innerList.traverse( sink ); + } + + sink.listItem_(); + } + + public ListBlock getInnerList() + { + return innerList; + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,41 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +/* + * Copyright 2004-2005 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.doxia.module.confluence.parser.AbstractFatherBlock; +import org.apache.maven.doxia.sink.Sink; + +import java.util.List; + +public class NumberedListBlock + extends ListBlock +{ + public NumberedListBlock( List childBlocks ) + { + super( childBlocks ); + } + + public void before( Sink sink ) + { + sink.numberedList( Sink.NUMBERING_DECIMAL ); + } + + public void after( Sink sink ) + { + sink.numberedList_(); + } +} Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java?rev=375400&view=auto ============================================================================== --- maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java (added) +++ maven/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java Mon Feb 6 14:31:55 2006 @@ -0,0 +1,118 @@ +package org.apache.maven.doxia.module.confluence.parser.list; + +/* +* Copyright 2004-2005 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. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS,
{'source': 'Apache Software Foundation Public Mail Archives'}