[xwiki-notifications] r10964 - in xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia: internal parser

vmassol (SVN) notifications at xwiki.org
Tue Jul 1 11:27:40 CEST 2008


Author: vmassol
Date: 2008-07-01 11:27:40 +0200 (Tue, 01 Jul 2008)
New Revision: 10964

Added:
   xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/XDOMGeneratorSink.java
Removed:
   xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/DocumentGeneratorSink.java
Modified:
   xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/parser/AbstractDoxiaParser.java
Log:
XWIKI-2508: Firm up the new rendering module implementation

* Fixed class name which wasn't changed in a previous refactoring

Deleted: xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/DocumentGeneratorSink.java
===================================================================
--- xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/DocumentGeneratorSink.java	2008-07-01 09:26:18 UTC (rev 10963)
+++ xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/DocumentGeneratorSink.java	2008-07-01 09:27:40 UTC (rev 10964)
@@ -1,636 +0,0 @@
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.xwiki.rendering.doxia.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Stack;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.maven.doxia.sink.Sink;
-import org.xwiki.rendering.block.AbstractBlock;
-import org.xwiki.rendering.block.Block;
-import org.xwiki.rendering.block.BoldBlock;
-import org.xwiki.rendering.block.BulletedListBlock;
-import org.xwiki.rendering.block.XDOM;
-import org.xwiki.rendering.block.ItalicBlock;
-import org.xwiki.rendering.block.ListItemBlock;
-import org.xwiki.rendering.block.NumberedListBlock;
-import org.xwiki.rendering.block.ParagraphBlock;
-import org.xwiki.rendering.block.SectionBlock;
-import org.xwiki.rendering.block.SpaceBlock;
-import org.xwiki.rendering.block.SpecialSymbolBlock;
-import org.xwiki.rendering.block.WordBlock;
-import org.xwiki.rendering.listener.Listener;
-import org.xwiki.rendering.listener.SectionLevel;
-
-/**
- * @version $Id$
- * @since 1.5M2
- */
-public class DocumentGeneratorSink implements Sink
-{
-    private Stack<Block> stack = new Stack<Block>();
-    
-    private final MarkerBlock marker = new MarkerBlock();
-    
-    private static final Pattern SPLIT_TEXT_PATTERN =
-        Pattern.compile("(\\w+)?([ <>=.\"\\?\\*!#\\$%'\\(\\)\\+,/:;@\\[\\]\\\\^_`\\{\\}\\|~])?");
-    
-    private class MarkerBlock extends AbstractBlock
-    {
-        public void traverse(Listener listener)
-        {
-        }
-    }
-
-    public XDOM getDOM()
-    {
-        return new XDOM(generateListFromStack());
-    }
-
-    public void anchor(String arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void anchor_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void author()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void author_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void body()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void body_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void bold()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void bold_()
-    {
-        this.stack.push(new BoldBlock(generateListFromStack()));
-    }
-
-    public void close()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void date()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void date_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definedTerm()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definedTerm_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definition()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definitionList()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definitionListItem()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definitionListItem_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definitionList_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void definition_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void figure()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void figureCaption()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void figureCaption_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void figureGraphics(String arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void figure_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void flush()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void head()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void head_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void horizontalRule()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void italic()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void italic_()
-    {
-        this.stack.push(new ItalicBlock(generateListFromStack()));
-    }
-
-    public void lineBreak()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void link(String arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void link_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void list()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void listItem()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void listItem_()
-    {
-        // Note: This means we support Paragraphs inside lists.
-        this.stack.push(new ListItemBlock(generateListFromStack()));
-    }
-
-    public void list_()
-    {
-        this.stack.push(new BulletedListBlock(generateListFromStack()));
-    }
-
-    public void monospaced()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void monospaced_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void nonBreakingSpace()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void numberedList(int arg0)
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void numberedListItem()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void numberedListItem_()
-    {
-        // Note: This means we support Paragraphs inside lists.
-        this.stack.push(new ListItemBlock(generateListFromStack()));
-    }
-
-    public void numberedList_()
-    {
-        this.stack.push(new NumberedListBlock(generateListFromStack()));
-    }
-
-    public void pageBreak()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void paragraph()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void paragraph_()
-    {
-        this.stack.push(new ParagraphBlock(generateListFromStack()));
-    }
-
-    public void rawText(String text)
-    {
-    }
-
-    public void section1()
-    {
-        this.stack.push(this.marker);
-    }
-
-    public void section1_()
-    {
-        List<Block> sectionTitleBlocks = generateListFromStack();
-        this.stack.push(new SectionBlock(sectionTitleBlocks, SectionLevel.LEVEL1));
-    }
-
-    public void section2()
-    {
-        // No need for a marker since we expect only a single TextBlock
-    }
-
-    public void section2_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section3()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section3_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section4()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section4_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section5()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void section5_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle1()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle1_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle2()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle2_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle3()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle3_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle4()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle4_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle5()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle5_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void sectionTitle_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void table()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableCaption()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableCaption_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableCell()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableCell(String arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableCell_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableHeaderCell()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableHeaderCell(String arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableHeaderCell_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableRow()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableRow_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableRows(int[] arg0, boolean arg1)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void tableRows_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void table_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void text(String text)
-    {
-        // Since Doxia doesn't generate events at the word level we need to reparse the
-        // text to extract spaces, special symbols and words.
-        Matcher matcher = SPLIT_TEXT_PATTERN.matcher(text);
-        while (matcher.find()) {
-            String word = matcher.group(1);
-            if (word != null) {
-                this.stack.push(new WordBlock(word));
-            }
-            String symbol = matcher.group(2);
-            if (symbol != null) {
-                if (symbol.equals(" ")) {
-                    this.stack.push(SpaceBlock.SPACE_BLOCK);
-                } else {
-                    this.stack.push(new SpecialSymbolBlock(symbol));
-                }
-            }
-        }
-    }
-
-    public void title()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void title_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void verbatim(boolean arg0)
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void verbatim_()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void comment(String comment)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void section_(int arg0)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void sectionTitle_(int arg0)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    private List<Block> generateListFromStack() 
-    {
-        List<Block> blocks = new ArrayList<Block>();
-        while (!this.stack.empty()) {
-            if (this.stack.peek() != this.marker) {
-                blocks.add(this.stack.pop());
-            } else {
-                this.stack.pop();
-                break;
-            }
-        }
-        Collections.reverse(blocks);
-        return blocks;
-    }
-}

Copied: xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/XDOMGeneratorSink.java (from rev 10882, xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/DocumentGeneratorSink.java)
===================================================================
--- xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/XDOMGeneratorSink.java	                        (rev 0)
+++ xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/XDOMGeneratorSink.java	2008-07-01 09:27:40 UTC (rev 10964)
@@ -0,0 +1,636 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.xwiki.rendering.doxia.internal;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Stack;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.xwiki.rendering.block.AbstractBlock;
+import org.xwiki.rendering.block.Block;
+import org.xwiki.rendering.block.BoldBlock;
+import org.xwiki.rendering.block.BulletedListBlock;
+import org.xwiki.rendering.block.XDOM;
+import org.xwiki.rendering.block.ItalicBlock;
+import org.xwiki.rendering.block.ListItemBlock;
+import org.xwiki.rendering.block.NumberedListBlock;
+import org.xwiki.rendering.block.ParagraphBlock;
+import org.xwiki.rendering.block.SectionBlock;
+import org.xwiki.rendering.block.SpaceBlock;
+import org.xwiki.rendering.block.SpecialSymbolBlock;
+import org.xwiki.rendering.block.WordBlock;
+import org.xwiki.rendering.listener.Listener;
+import org.xwiki.rendering.listener.SectionLevel;
+
+/**
+ * @version $Id$
+ * @since 1.5M2
+ */
+public class XDOMGeneratorSink implements Sink
+{
+    private Stack<Block> stack = new Stack<Block>();
+    
+    private final MarkerBlock marker = new MarkerBlock();
+    
+    private static final Pattern SPLIT_TEXT_PATTERN =
+        Pattern.compile("(\\w+)?([ <>=.\"\\?\\*!#\\$%'\\(\\)\\+,/:;@\\[\\]\\\\^_`\\{\\}\\|~])?");
+    
+    private class MarkerBlock extends AbstractBlock
+    {
+        public void traverse(Listener listener)
+        {
+        }
+    }
+
+    public XDOM getDOM()
+    {
+        return new XDOM(generateListFromStack());
+    }
+
+    public void anchor(String arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void anchor_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void author()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void author_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void body()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void body_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void bold()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void bold_()
+    {
+        this.stack.push(new BoldBlock(generateListFromStack()));
+    }
+
+    public void close()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void date()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void date_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definedTerm()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definedTerm_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definition()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definitionList()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definitionListItem()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definitionListItem_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definitionList_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void definition_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void figure()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void figureCaption()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void figureCaption_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void figureGraphics(String arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void figure_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void flush()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void head()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void head_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void horizontalRule()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void italic()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void italic_()
+    {
+        this.stack.push(new ItalicBlock(generateListFromStack()));
+    }
+
+    public void lineBreak()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void link(String arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void link_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void list()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void listItem()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void listItem_()
+    {
+        // Note: This means we support Paragraphs inside lists.
+        this.stack.push(new ListItemBlock(generateListFromStack()));
+    }
+
+    public void list_()
+    {
+        this.stack.push(new BulletedListBlock(generateListFromStack()));
+    }
+
+    public void monospaced()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void monospaced_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void nonBreakingSpace()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void numberedList(int arg0)
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void numberedListItem()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void numberedListItem_()
+    {
+        // Note: This means we support Paragraphs inside lists.
+        this.stack.push(new ListItemBlock(generateListFromStack()));
+    }
+
+    public void numberedList_()
+    {
+        this.stack.push(new NumberedListBlock(generateListFromStack()));
+    }
+
+    public void pageBreak()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void paragraph()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void paragraph_()
+    {
+        this.stack.push(new ParagraphBlock(generateListFromStack()));
+    }
+
+    public void rawText(String text)
+    {
+    }
+
+    public void section1()
+    {
+        this.stack.push(this.marker);
+    }
+
+    public void section1_()
+    {
+        List<Block> sectionTitleBlocks = generateListFromStack();
+        this.stack.push(new SectionBlock(sectionTitleBlocks, SectionLevel.LEVEL1));
+    }
+
+    public void section2()
+    {
+        // No need for a marker since we expect only a single TextBlock
+    }
+
+    public void section2_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section3()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section3_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section4()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section4_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section5()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void section5_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle1()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle1_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle2()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle2_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle3()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle3_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle4()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle4_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle5()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle5_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void sectionTitle_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void table()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableCaption()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableCaption_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableCell()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableCell(String arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableCell_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableHeaderCell()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableHeaderCell(String arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableHeaderCell_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableRow()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableRow_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableRows(int[] arg0, boolean arg1)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void tableRows_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void table_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void text(String text)
+    {
+        // Since Doxia doesn't generate events at the word level we need to reparse the
+        // text to extract spaces, special symbols and words.
+        Matcher matcher = SPLIT_TEXT_PATTERN.matcher(text);
+        while (matcher.find()) {
+            String word = matcher.group(1);
+            if (word != null) {
+                this.stack.push(new WordBlock(word));
+            }
+            String symbol = matcher.group(2);
+            if (symbol != null) {
+                if (symbol.equals(" ")) {
+                    this.stack.push(SpaceBlock.SPACE_BLOCK);
+                } else {
+                    this.stack.push(new SpecialSymbolBlock(symbol));
+                }
+            }
+        }
+    }
+
+    public void title()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void title_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void verbatim(boolean arg0)
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void verbatim_()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void comment(String comment)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void section_(int arg0)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void sectionTitle_(int arg0)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    private List<Block> generateListFromStack() 
+    {
+        List<Block> blocks = new ArrayList<Block>();
+        while (!this.stack.empty()) {
+            if (this.stack.peek() != this.marker) {
+                blocks.add(this.stack.pop());
+            } else {
+                this.stack.pop();
+                break;
+            }
+        }
+        Collections.reverse(blocks);
+        return blocks;
+    }
+}


Property changes on: xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/internal/XDOMGeneratorSink.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/parser/AbstractDoxiaParser.java
===================================================================
--- xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/parser/AbstractDoxiaParser.java	2008-07-01 09:26:18 UTC (rev 10963)
+++ xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-doxia/src/main/java/org/xwiki/rendering/doxia/parser/AbstractDoxiaParser.java	2008-07-01 09:27:40 UTC (rev 10964)
@@ -23,7 +23,7 @@
 import org.xwiki.rendering.parser.Parser;
 import org.xwiki.rendering.parser.ParseException;
 import org.xwiki.rendering.block.XDOM;
-import org.xwiki.rendering.doxia.internal.DocumentGeneratorSink;
+import org.xwiki.rendering.doxia.internal.XDOMGeneratorSink;
 
 import java.io.Reader;
 
@@ -38,7 +38,7 @@
     public XDOM parse(Reader source) throws ParseException
     {
         org.apache.maven.doxia.parser.Parser parser = createDoxiaParser();
-        DocumentGeneratorSink sink = new DocumentGeneratorSink();
+        XDOMGeneratorSink sink = new XDOMGeneratorSink();
 
         try {
             parser.parse(source, sink);



More information about the notifications mailing list