You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2008/09/18 00:06:14 UTC

svn commit: r696490 - in /maven/doxia/doxia/trunk: doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/ doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/ doxia-modules/doxia-module...

Author: vsiveton
Date: Wed Sep 17 15:06:14 2008
New Revision: 696490

URL: http://svn.apache.org/viewvc?rev=696490&view=rev
Log:
DOXIA-253: Implement SinkFactory for all supported modules

o removed plexus component in modules Sink 
o updated the SinkFactory interface to support Writer
o implemented SinkFactory for all modules

Added:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java   (with props)
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java   (with props)
Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
    maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java Wed Sep 17 15:06:14 2008
@@ -34,7 +34,6 @@
  * @author eredmond
  * @version $Id$
  * @since 1.0
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="apt"
  */
 public class AptSink
     extends AbstractTextSink

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.apt;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * APT implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="apt"
+ */
+public class AptSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new AptSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new AptSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.docbook;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * Docbook implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="docbook"
+ */
+public class DocbookSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new DocBookSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new DocBookSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocbookSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.fo;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * FO implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="fo"
+ */
+public class FoSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new FoSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new FoSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java Wed Sep 17 15:06:14 2008
@@ -58,8 +58,6 @@
  *
  * @see <a href="http://www.lowagie.com/iText/tutorial/ch07.html">http://www.lowagie.com/iText/tutorial/ch07.html</a>
  *
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="pdf"
- *
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
  * @version $Id$
  */

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.itext;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * IText implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="itext"
+ */
+public class ITextSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new ITextSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new ITextSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java Wed Sep 17 15:06:14 2008
@@ -35,8 +35,8 @@
 /**
  * Latex Sink implementation.
  *
+ * @version $Id$
  * @since 1.0
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="tex"
  */
 public class LatexSink
     extends AbstractTextSink
@@ -729,7 +729,7 @@
     {
         tableCell( false );
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -745,7 +745,7 @@
     {
         tableCell( true );
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -753,9 +753,9 @@
     {
         tableCell_( true );
     }
-    
+
     private boolean lastCellWasHeader = false;
-    
+
     /**
      * Starts a table cell.
      *
@@ -764,7 +764,7 @@
     private void tableCell( boolean header )
     {
         lastCellWasHeader = header;
-        
+
         if ( cellCount > 0 )
         {
             markup( " &" + EOL );

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.latex;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * Latex implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="latex"
+ */
+public class LatexSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new LatexSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new LatexSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java Wed Sep 17 15:06:14 2008
@@ -39,7 +39,7 @@
 
 /**
  * @version $Id$
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="rtf"
+ * @since 1.0
  */
 public class RtfSink
     extends SinkAdapter

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,69 @@
+package org.apache.maven.doxia.module.rtf;
+
+/*
+ * 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 java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * APT implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="rtf"
+ */
+public class RtfSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        OutputStream os = new FileOutputStream( new File( outputDir, outputName ) );
+
+        return new RtfSink( os );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        throw new UnsupportedOperationException( "createSink( Writer writer ) is not implemented." );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java Wed Sep 17 15:06:14 2008
@@ -37,7 +37,6 @@
  * @author <a href="mailto:james@jamestaylor.org">James Taylor</a>
  * @version $Id$
  * @since 1.0
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="xdoc"
  */
 public class XdocSink
     extends XhtmlBaseSink

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.xdoc;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * Xdoc implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="xdoc"
+ */
+public class XdocSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new XdocSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new XdocSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java Wed Sep 17 15:06:14 2008
@@ -38,7 +38,6 @@
  * @author ltheussl
  * @version $Id$
  * @since 1.0
- * @plexus.component role="org.apache.maven.doxia.sink.Sink" role-hint="xhtml"
  */
 public class XhtmlSink
     extends XhtmlBaseSink

Added: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java?rev=696490&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java (added)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java Wed Sep 17 15:06:14 2008
@@ -0,0 +1,67 @@
+package org.apache.maven.doxia.module.xhtml;
+
+/*
+ * 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 java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkFactory;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * Xhtml implementation of the Sink factory.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0
+ * @plexus.component role="org.apache.maven.doxia.sink.SinkFactory" role-hint="xhtml"
+ */
+public class XhtmlSinkFactory
+    implements SinkFactory
+{
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName )
+        throws IOException
+    {
+        return createSink( outputDir, outputName, WriterFactory.UTF_8 );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException
+    {
+        if ( !outputDir.isDirectory() )
+        {
+            throw new IllegalArgumentException( "The dir '" + outputDir + "' is not a directory or not exist" );
+        }
+
+        Writer writer = WriterFactory.newWriter( new File( outputDir, outputName ), encoding );
+
+        return new XhtmlSink( writer );
+    }
+
+    /** {@inheritDoc} */
+    public Sink createSink( Writer writer )
+    {
+        return new XhtmlSink( writer );
+    }
+}

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java?rev=696490&r1=696489&r2=696490&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java (original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkFactory.java Wed Sep 17 15:06:14 2008
@@ -20,19 +20,45 @@
  */
 
 import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
 
 /**
  * A factory that creates a <code>Sink</code> object.
  *
  * @author <a href="kenney@apache.org">Kenney Westerhof</a>
  * @version $Id$
+ * @since 1.0
  */
 public interface SinkFactory
 {
     /**
-     * @param outputDir the output dir
-     * @param outputName the output name
-     * @return a <code>Sink</code> instance
+     * The Plexus SinkFactory Role.
      */
-    Sink createSink( File outputDir, String outputName );
+    String ROLE = SinkFactory.class.getName();
+
+    /**
+     * @param outputDir the not-null output dir.
+     * @param outputName the not-null output name.
+     * @return a <code>Sink</code> instance with a file as output and using UTF-8 as encoding.
+     * @throws IOException if any
+     */
+    Sink createSink( File outputDir, String outputName )
+        throws IOException;
+
+    /**
+     * @param outputDir the not-null output dir.
+     * @param outputName the not-null output name.
+     * @param encoding the output encoding.
+     * @return a <code>Sink</code> instance with a file as output.
+     * @throws IOException if any
+     */
+    Sink createSink( File outputDir, String outputName, String encoding )
+        throws IOException;
+
+    /**
+     * @param writer a not-null writer.
+     * @return a <code>Sink</code> instance.
+     */
+    Sink createSink( Writer writer );
 }