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>