Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 7496e6176cdd537856e505933283c7fe279d947d @tucu00 tucu00 committed Sep 4, 2010
Showing with 16,158 additions and 0 deletions.
  1. +99 −0 doxia-core/pom.xml
  2. +68 −0 doxia-core/src/main/java/org/apache/maven/doxia/DefaultDoxia.java
  3. +65 −0 doxia-core/src/main/java/org/apache/maven/doxia/Doxia.java
  4. +311 −0 doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
  5. +249 −0 doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
  6. +33 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
  7. +53 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java
  8. +46 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java
  9. +55 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroExecutionException.java
  10. +91 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java
  11. +185 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
  12. +52 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/attachurl/AttachUrlMacro.java
  13. +43 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/attachurl/AttachUrlPathMacro.java
  14. +48 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/code/CodeMacro.java
  15. +42 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/code/EndCodeMacro.java
  16. +40 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/AbstractColorMacro.java
  17. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorAquaMacro.java
  18. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorBlackMacro.java
  19. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorBlueMacro.java
  20. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorGrayMacro.java
  21. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorGreenMacro.java
  22. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorLimeMacro.java
  23. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorMaroonMacro.java
  24. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorNavyMacro.java
  25. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorOliveMacro.java
  26. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorPinkMacro.java
  27. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorPurpleMacro.java
  28. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorRedMacro.java
  29. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorSilverMacro.java
  30. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorTealMacro.java
  31. +40 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/ColorYellowMacro.java
  32. +40 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/color/EndColorMacro.java
  33. +53 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java
  34. +47 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/MacroManager.java
  35. +71 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/MacroNotFoundException.java
  36. +283 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
  37. +186 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
  38. +239 −0 doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java
  39. +76 −0 doxia-core/src/main/java/org/apache/maven/doxia/markup/Markup.java
  40. +38 −0 doxia-core/src/main/java/org/apache/maven/doxia/markup/TextMarkup.java
  41. +45 −0 doxia-core/src/main/java/org/apache/maven/doxia/markup/XmlMarkup.java
  42. +50 −0 doxia-core/src/main/java/org/apache/maven/doxia/module/site/AbstractSiteModule.java
  43. +51 −0 doxia-core/src/main/java/org/apache/maven/doxia/module/site/SiteModule.java
  44. +62 −0 doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java
  45. +55 −0 doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java
  46. +72 −0 doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleNotFoundException.java
  47. +102 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractParser.java
  48. +40 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractTextParser.java
  49. +157 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
  50. +134 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/ParseException.java
  51. +75 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/Parser.java
  52. +55 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/DefaultParserManager.java
  53. +46 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/ParserManager.java
  54. +71 −0 doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/ParserNotFoundException.java
  55. +36 −0 doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractTextSink.java
  56. +183 −0 doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
  57. +67 −0 doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java
  58. +566 −0 doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java
  59. +68 −0 doxia-core/src/main/java/org/apache/maven/doxia/sink/StructureSink.java
  60. +162 −0 doxia-core/src/main/java/org/apache/maven/doxia/util/ByLineReaderSource.java
  61. +67 −0 doxia-core/src/main/java/org/apache/maven/doxia/util/ByLineSource.java
  62. +308 −0 doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
  63. +211 −0 doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java
  64. +193 −0 doxia-core/src/test/java/org/apache/maven/doxia/AbstractModuleTest.java
  65. +560 −0 doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java
  66. +69 −0 doxia-core/src/test/java/org/apache/maven/doxia/index/IndexEntryTest.java
  67. +36 −0 doxia-core/src/test/java/org/apache/maven/doxia/macro/MacroManagerTest.java
  68. +151 −0 doxia-core/src/test/java/org/apache/maven/doxia/module/AbstractIdentityTest.java
  69. +135 −0 doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
  70. +77 −0 doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTestCase.java
  71. +919 −0 doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java
  72. +105 −0 doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTestCase.java
  73. +603 −0 doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
  74. +78 −0 doxia-core/src/test/java/org/apache/maven/doxia/sink/StructureSinkTest.java
  75. +626 −0 doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java
  76. +67 −0 doxia-core/src/test/java/org/apache/maven/doxia/util/ByLineReaderSourceTest.java
  77. +83 −0 doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java
  78. +92 −0 doxia-module-twiki/pom.xml
  79. +22 −0 doxia-module-twiki/src/main/components/components.xml
  80. +205 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java
  81. +60 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSiteModule.java
  82. +147 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AbstractFatherBlock.java
  83. +90 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AnchorBlock.java
  84. +42 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/Block.java
  85. +48 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/BlockParser.java
  86. +60 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/BoldBlock.java
  87. +302 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java
  88. +578 −0 ...module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java
  89. +84 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/HRuleBlockParser.java
  90. +61 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/HorizontalRuleBlock.java
  91. +62 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ItalicBlock.java
  92. +135 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/LinkBlock.java
  93. +48 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ListBlock.java
  94. +139 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ListItemBlock.java
  95. +251 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/MacroBlock.java
  96. +62 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/MonospaceBlock.java
  97. +60 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/NopBlock.java
  98. +101 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/NumeratedListBlock.java
  99. +47 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlock.java
  100. +256 −0 ...a-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java
  101. +321 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlock.java
  102. +147 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java
  103. +77 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/State.java
  104. +81 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/StringLineSource.java
  105. +77 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlock.java
  106. +121 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java
  107. +61 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableCellBlock.java
  108. +61 −0 ...a-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableCellHeaderBlock.java
  109. +62 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableRowBlock.java
  110. +185 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TagBlock.java
  111. +111 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextBlock.java
  112. +394 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java
  113. +69 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/UnorderedListBlock.java
  114. +112 −0 doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/WikiWordBlock.java
  115. +109 −0 doxia-module-twiki/src/main/resources/TWikiParserTest.twiki
  116. +87 −0 ...-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/AbstractBlockTestCase.java
  117. +168 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/BlockTest.java
  118. +261 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextTest.java
  119. +157 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ListTest.java
  120. +204 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ParagraphTest.java
  121. +191 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/SectionTest.java
  122. +96 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/TableTest.java
  123. +264 −0 doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/WordsTest.java
  124. +38 −0 dummy/pom.xml
  125. +21 −0 dummy/src/main/java/Dummy.java
  126. +16 −0 dummy/src/site/site.xml
  127. +203 −0 license.txt
  128. +28 −0 pom.xml
  129. +14 −0 readme.txt
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>doxia</artifactId>
+ <groupId>org.apache.maven.doxia</groupId>
+ <version>1.0-alpha-9</version>
+ </parent>
+ <artifactId>doxia-core</artifactId>
+ <version>1.0-alpha-9.2y</version>
+ <name>Doxia :: Core</name>
+ <description>Doxia core classes and interfaces.</description>
+
+ <properties>
+ <internal.maven.repository>file:///tmp/internalmavenrepo</internal.maven.repository>
+ </properties>
+ <distributionManagement>
+ <repository>
+ <id>internal.maven.repo</id>
+ <name>Internal Repository for Integration</name>
+ <url>${internal.maven.repository}</url>
+ </repository>
+ </distributionManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <artifactId>com.yahoo.oozie</artifactId>
+ <groupId>doxia-dummy</groupId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ <version>2.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-sink-api</artifactId>
+ <version>1.0-alpha-9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </dependency>
+ -->
+ </dependencies>
+</project>
@@ -0,0 +1,68 @@
+package org.apache.maven.doxia;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.parser.ParseException;
+import org.apache.maven.doxia.parser.Parser;
+import org.apache.maven.doxia.parser.manager.ParserManager;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.sink.Sink;
+
+import java.io.Reader;
+
+/**
+ * Simple implementation of the Doxia interface:
+ * uses a ParserManager to lookup a parser.
+ *
+ * @author Jason van Zyl
+ * @version $Id: DefaultDoxia.java 564180 2007-08-09 12:15:44Z vsiveton $
+ * @since 1.0
+ * @plexus.component
+ */
+public class DefaultDoxia
+ implements Doxia
+{
+ /**
+ * @plexus.requirement
+ */
+ private ParserManager parserManager;
+
+ // ----------------------------------------------------------------------
+ // This remains because the sinks are not threadsafe which they probably
+ // should be. In some places a constructor is used to initialize a sink
+ // which can probably be done away with.
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void parse( Reader source, String parserId, Sink sink )
+ throws ParserNotFoundException, ParseException
+ {
+ Parser parser = parserManager.getParser( parserId );
+
+ parser.parse( source, sink );
+ }
+
+ /** {@inheritDoc} */
+ public Parser getParser( String parserId )
+ throws ParserNotFoundException
+ {
+ return parserManager.getParser( parserId );
+ }
+}
@@ -0,0 +1,65 @@
+package org.apache.maven.doxia;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.parser.ParseException;
+import org.apache.maven.doxia.parser.Parser;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.sink.Sink;
+
+import java.io.Reader;
+
+/**
+ * Basic interface of the Doxia framework.
+ *
+ * @author Jason van Zyl
+ * @version $Id: Doxia.java 564180 2007-08-09 12:15:44Z vsiveton $
+ * @since 1.0
+ */
+public interface Doxia
+{
+ /** The Plexus lookup role. */
+ String ROLE = Doxia.class.getName();
+
+ /**
+ * Parses the given source model using a parser with given id,
+ * and emits Doxia events into the given sink.
+ *
+ * @param source A reader that provides the source document.
+ * @param parserId Identifier for the parser to use.
+ * @param sink A sink that consumes the Doxia events.
+ * @throws ParserNotFoundException if no parser could be found
+ * for the given id.
+ * @throws ParseException if the model could not be parsed.
+ */
+ void parse( Reader source, String parserId, Sink sink )
+ throws ParserNotFoundException, ParseException;
+
+ /**
+ * Return a parser for the given <code>parserId</code>.
+ *
+ * @param parserId Identifier for the parser to use.
+ * @return the parser defining by parserId.
+ * @throws ParserNotFoundException if no parser could be found
+ * for the given id.
+ */
+ Parser getParser( String parserId )
+ throws ParserNotFoundException;
+}
Oops, something went wrong.

0 comments on commit 7496e61

Please sign in to comment.