You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2007/09/05 16:22:59 UTC
svn commit: r572956 - in
/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book:
./ context/ services/indexer/ services/io/ services/renderer/
services/renderer/latex/ services/renderer/xdoc/ services/validation/
Author: ltheussl
Date: Wed Sep 5 07:22:50 2007
New Revision: 572956
URL: http://svn.apache.org/viewvc?rev=572956&view=rev
Log:
Javadocs, formatting. No code changes.
Modified:
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaCli.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java Wed Sep 5 07:22:50 2007
@@ -25,16 +25,35 @@
import java.util.List;
/**
+ * An interface to create books in different output formats from a book descriptor.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public interface BookDoxia
{
+ /** The plexus lookup role. */
String ROLE = BookDoxia.class.getName();
+ /**
+ * Load a BookModel from a descriptor file.
+ *
+ * @param bookDescriptor the book descriptor file.
+ * @return BookModel
+ * @throws BookDoxiaException if the model cannot be loaded.
+ */
BookModel loadBook( File bookDescriptor )
throws BookDoxiaException;
+ /**
+ * Creates a book from a BookModel.
+ *
+ * @param book the BookModel.
+ * @param bookRendererId the id of the output format.
+ * @param files a list of source files.
+ * @param outputDirectory the output directory.
+ * @throws BookDoxiaException if the model cannot be loaded.
+ */
void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory )
throws BookDoxiaException;
}
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaCli.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaCli.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaCli.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaCli.java Wed Sep 5 07:22:50 2007
@@ -31,22 +31,32 @@
import java.util.List;
/**
+ * Invoke BookDoxia from the command line.
+ *
* @author Jason van Zyl
*/
public class BookDoxiaCli
extends AbstractCli
{
+ /**
+ * Execute the BookDoxia command line interface.
+ *
+ * @param args command line options.
+ * @throws Exception if something goes wrong.
+ */
public static void main( String[] args )
throws Exception
{
new BookDoxiaCli().execute( args );
}
+ /** {@inheritDoc} */
public String getPomPropertiesPath()
{
return "META-INF/maven/org.apache.maven.doxia/doxia-book/pom.properties";
}
+ /** {@inheritDoc} */
public Options buildCliOptions( Options options )
{
options.addOption( OptionBuilder.withLongOpt( "book-xml" ).hasArg().withDescription(
@@ -64,6 +74,7 @@
return options;
}
+ /** {@inheritDoc} */
public void invokePlexusComponent( CommandLine cli,
PlexusContainer plexus )
throws Exception
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java Wed Sep 5 07:22:50 2007
@@ -20,17 +20,31 @@
*/
/**
+ * Wraps an exception when rendering books.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public class BookDoxiaException
extends Exception
{
+ /**
+ * Construct a new BookDoxiaException with the specified detail message.
+ *
+ * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method.
+ */
public BookDoxiaException( String message )
{
super( message );
}
+ /**
+ * Construct a new BookDoxiaException with the specified detail message and cause.
+ *
+ * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method.
+ * @param cause the cause. This can be retrieved later by the Throwable.getCause() method
+ * (a null value is permitted, and indicates that the cause is nonexistent or unknown).
+ */
public BookDoxiaException( String message, Throwable cause )
{
super( message, cause );
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java Wed Sep 5 07:22:50 2007
@@ -33,6 +33,8 @@
import java.util.Map;
/**
+ * Default implementation of BookDoxia.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
* @plexus.component
@@ -65,12 +67,14 @@
// BookDoxia Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public BookModel loadBook( File bookDescriptor )
throws BookDoxiaException
{
return bookIo.readBook( bookDescriptor );
}
+ /** {@inheritDoc} */
public void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory )
throws BookDoxiaException
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java Wed Sep 5 07:22:50 2007
@@ -22,14 +22,22 @@
import org.apache.maven.doxia.book.services.validation.ValidationResult;
/**
+ * Indicates that the book descriptor file could not be parsed correctly.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public class InvalidBookDescriptorException
extends BookDoxiaException
{
+ /** ValidationResult. */
private ValidationResult validationResult;
+ /**
+ * Construct a new InvalidBookDescriptorException and stores the given ValidationResult.
+ *
+ * @param validationResult The ValidationResult to store.
+ */
public InvalidBookDescriptorException( ValidationResult validationResult )
{
super( "Invalid book descriptor." );
@@ -37,6 +45,11 @@
this.validationResult = validationResult;
}
+ /**
+ * Return the ValidationResult.
+ *
+ * @return the ValidationResult associated with this Exception.
+ */
public ValidationResult getValidationResult()
{
return validationResult;
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java Wed Sep 5 07:22:50 2007
@@ -21,45 +21,70 @@
import org.apache.maven.doxia.book.model.BookModel;
+import java.io.File;
import java.util.Map;
import java.util.HashMap;
-import java.io.File;
/**
+ * Context to render a book.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public class BookContext
{
+ /** The BookModel of this context. */
private BookModel book;
+ /** The files. */
private Map files;
+ /** The output directory. */
private File outputDirectory;
+ /** The BookIndex of this context. */
private BookIndex index;
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
+ /** Represents a BookFile. */
public static class BookFile
{
+ /** The file. */
private File file;
+ /** The id of the parser. */
private String parserId;
+ /**
+ * Constructor.
+ *
+ * @param file the file.
+ * @param parserId the parser id.
+ */
public BookFile( File file, String parserId )
{
this.file = file;
this.parserId = parserId;
}
+ /**
+ * Return the file of this BookFile.
+ *
+ * @return File.
+ */
public File getFile()
{
return file;
}
+ /**
+ * Return the parserId of this BookFile.
+ *
+ * @return String.
+ */
public String getParserId()
{
return parserId;
@@ -70,16 +95,31 @@
// Accessors
// ----------------------------------------------------------------------
+ /**
+ * Return the BookModel of this BookContext.
+ *
+ * @return BookModel.
+ */
public BookModel getBook()
{
return book;
}
+ /**
+ * Set the BookModel of this BookContext.
+ *
+ * @param book the BookModel.
+ */
public void setBook( BookModel book )
{
this.book = book;
}
+ /**
+ * Return the files of this BookContext.
+ *
+ * @return Map. A new HashMap is constructed if the current Map is null.
+ */
public Map getFiles()
{
if ( files == null )
@@ -90,26 +130,51 @@
return files;
}
+ /**
+ * Set the files of this BookContext.
+ *
+ * @param files the Map of files.
+ */
public void setFiles( Map files )
{
this.files = files;
}
+ /**
+ * Return the outputDirectory of this BookContext.
+ *
+ * @return File.
+ */
public File getOutputDirectory()
{
return outputDirectory;
}
+ /**
+ * Set the outputDirectory of this BookContext.
+ *
+ * @param outputDirectory the output directory.
+ */
public void setOutputDirectory( File outputDirectory )
{
this.outputDirectory = outputDirectory;
}
+ /**
+ * Return the index of this BookContext.
+ *
+ * @return BookIndex.
+ */
public BookIndex getIndex()
{
return index;
}
+ /**
+ * Set the index of this BookContext.
+ *
+ * @param index the index to set.
+ */
public void setIndex( BookIndex index )
{
this.index = index;
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java Wed Sep 5 07:22:50 2007
@@ -1,4 +1,5 @@
package org.apache.maven.doxia.book.context;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -27,6 +28,7 @@
public class BookIndex
extends IndexEntry
{
+ /** Constructs a new BookIndex. */
public BookIndex()
{
super( "book" );
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java Wed Sep 5 07:22:50 2007
@@ -24,13 +24,23 @@
import org.apache.maven.doxia.book.BookDoxiaException;
/**
+ * Index a book.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public interface BookIndexer
{
+ /** The plexus lookup role. */
String ROLE = BookIndexer.class.getName();
+ /**
+ * Index a book.
+ *
+ * @param book the book to index.
+ * @param bookContext the BookContext.
+ * @throws BookDoxiaException if the book cannot be indexed.
+ */
void indexBook( BookModel book, BookContext bookContext )
throws BookDoxiaException;
}
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java Wed Sep 5 07:22:50 2007
@@ -37,6 +37,8 @@
import org.codehaus.plexus.logging.AbstractLogEnabled;
/**
+ * Default implementation of BookIndexer.
+ *
* @plexus.component
*
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -55,6 +57,7 @@
// BookIndexer Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void indexBook( BookModel book, BookContext bookContext )
throws BookDoxiaException
{
@@ -74,6 +77,14 @@
// Private
// ----------------------------------------------------------------------
+ /**
+ * Index a chapter.
+ *
+ * @param context the BookContext.
+ * @param bookEntry the IndexEntry.
+ * @param chapter the Chapter to index.
+ * @throws BookDoxiaException if the chapter cannot be indexed.
+ */
private void indexChapter( BookContext context, IndexEntry bookEntry, Chapter chapter )
throws BookDoxiaException
{
@@ -89,6 +100,14 @@
}
}
+ /**
+ * Index a section.
+ *
+ * @param bookContext the BookContext.
+ * @param chapterEntry the IndexEntry.
+ * @param section the Section to index.
+ * @throws BookDoxiaException if the section cannot be indexed.
+ */
private void indexSection( BookContext bookContext, IndexEntry chapterEntry, Section section )
throws BookDoxiaException
{
@@ -96,7 +115,8 @@
if ( bookFile == null )
{
- throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ throw new BookDoxiaException( "No document that matches section with id="
+ + section.getId() + "." );
}
// ----------------------------------------------------------------------
@@ -113,15 +133,18 @@
}
catch ( ParserNotFoundException e )
{
- throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+ throw new BookDoxiaException( "Parser not found: "
+ + bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
- throw new BookDoxiaException( "Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ throw new BookDoxiaException( "Error while parsing document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( FileNotFoundException e )
{
- throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ throw new BookDoxiaException( "Could not find document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
}
sectionEntry.setTitle( sink.getTitle() );
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java Wed Sep 5 07:22:50 2007
@@ -27,15 +27,31 @@
import java.util.List;
/**
+ * Common book-related IO methods.
+ *
* @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
* @version $Id$
*/
public interface BookIo
{
+ /** The plexus lookup role. */
String ROLE = BookIo.class.getName();
+ /**
+ * Read a BookModel from a descriptor file.
+ *
+ * @param bookDescriptor the book descriptor file.
+ * @return BookModel
+ * @throws BookDoxiaException if the model cannot be read.
+ */
BookModel readBook( File bookDescriptor )
throws BookDoxiaException;
+ /**
+ * Loads files in a given context.
+ *
+ * @param context the BookContext.
+ * @param files a list of files.
+ */
void loadFiles( BookContext context, List files );
}
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java Wed Sep 5 07:22:50 2007
@@ -56,6 +56,7 @@
// DefaultBookIo Implementation
// -----------------------------------------------------------------------
+ /** {@inheritDoc} */
public BookModel readBook( File bookDescriptor )
throws BookDoxiaException
{
@@ -73,6 +74,7 @@
}
}
+ /** {@inheritDoc} */
public void loadFiles( BookContext context, List files )
{
// ----------------------------------------------------------------------
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -65,6 +65,7 @@
// BookRenderer Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void renderBook( BookContext context )
throws BookDoxiaException
{
@@ -167,18 +168,18 @@
}
/**
- * Get the output extension supported
+ * Get the output extension supported.
*
- * @return the ouput extension supported
+ * @return the ouput extension supported.
*/
public abstract String getOutputExtension();
/**
- * Generate an ouput file with the iText framework
+ * Generate an ouput file with the iText framework.
*
- * @param iTextFile
- * @param iTextOutput
- * @throws IOException if any
+ * @param iTextFile the input file.
+ * @param iTextOutput the output file.
+ * @throws IOException if any.
*/
public abstract void renderXML( File iTextFile, File iTextOutput )
throws IOException;
@@ -187,6 +188,14 @@
// Private
// ----------------------------------------------------------------------
+ /**
+ * Write a chapter.
+ *
+ * @param writer the writer.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
private void renderChapter( PrettyPrintXMLWriter writer, Chapter chapter, BookContext context )
throws BookDoxiaException
{
@@ -211,6 +220,14 @@
writer.endElement(); // chapter
}
+ /**
+ * Write a section.
+ *
+ * @param writer the writer.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
private void renderSection( PrettyPrintXMLWriter writer, Section section, BookContext context )
throws BookDoxiaException
{
@@ -260,6 +277,18 @@
// writer.endElement(); // section
}
+ /**
+ * Start a title.
+ *
+ * @param writer the writer.
+ * @param leading leading.
+ * @param font the font.
+ * @param size the size.
+ * @param fontstyle the fontstyle.
+ * @param red red.
+ * @param green green.
+ * @param blue blue.
+ */
private void startTitle( PrettyPrintXMLWriter writer, String leading, String font, String size, String fontstyle,
String red, String green, String blue )
{
@@ -273,6 +302,18 @@
writer.addAttribute( "blue", blue );
}
+ /**
+ * Write a chunk.
+ *
+ * @param writer the writer.
+ * @param title the title.
+ * @param font the font.
+ * @param size the size.
+ * @param fontstyle the fontstyle.
+ * @param red red.
+ * @param green green.
+ * @param blue blue.
+ */
private void chunk( PrettyPrintXMLWriter writer, String title, String font, String size, String fontstyle,
String red, String green, String blue )
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java Wed Sep 5 07:22:50 2007
@@ -23,13 +23,22 @@
import org.apache.maven.doxia.book.BookDoxiaException;
/**
+ * Render a book.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public interface BookRenderer
{
+ /** The plexus lookup role. */
String ROLE = BookRenderer.class.getName();
+ /**
+ * Render a book.
+ *
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the book cannot be rendered.
+ */
void renderBook( BookContext context )
throws BookDoxiaException;
}
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -1,5 +1,24 @@
package org.apache.maven.doxia.book.services.renderer;
+/*
+ * 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.FileNotFoundException;
import java.io.FileReader;
@@ -38,6 +57,7 @@
// BookRenderer Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void renderBook( BookContext context ) throws BookDoxiaException
{
BookModel book = context.getBook();
@@ -91,6 +111,15 @@
}
}
+ /**
+ * Write a chapter.
+ *
+ * @param writer the writer.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @param sink a Sink.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
private void renderChapter( Writer writer, Chapter chapter, BookContext context, Sink sink )
throws BookDoxiaException
{
@@ -102,6 +131,15 @@
}
}
+ /**
+ * Write a section.
+ *
+ * @param writer the writer.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @param sink a Sink.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
private void renderSection( Writer writer, Section section, BookContext context, Sink sink )
throws BookDoxiaException
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -60,6 +60,7 @@
// BookRenderer Implementatino
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void renderBook( BookContext context )
throws BookDoxiaException
{
@@ -100,13 +101,25 @@
// Private
// ----------------------------------------------------------------------
+ /** SectionInfo: id and title. */
private static class SectionInfo
{
+ /** id. */
private String id;
+ /** title. */
private String title;
}
+ /**
+ * Write a book.
+ *
+ * @param book the BookModel to write.
+ * @param context the BookContext.
+ * @param writer the writer to use.
+ * @throws IOException if any.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
private void writeBook( BookModel book, BookContext context, PrintWriter writer )
throws IOException, BookDoxiaException
{
@@ -135,7 +148,7 @@
// ----------------------------------------------------------------------
writer.println( "\\documentclass{book}" );
- writer.println( "\\title{" + book.getTitle() + "}");
+ writer.println( "\\title{" + book.getTitle() + "}" );
if ( StringUtils.isNotEmpty( book.getAuthor() ) )
{
@@ -149,10 +162,10 @@
writer.print( IOUtil.toString( LatexSink.getDefaultSinkCommands() ) );
writer.print( IOUtil.toString( LatexSink.getDefaultPreamble() ) );
- writer.println( "\\begin{document}");
- writer.println( "\\maketitle");
- writer.println( "\\tableofcontents");
-// writer.println( "\\listoffigures");
+ writer.println( "\\begin{document}" );
+ writer.println( "\\maketitle" );
+ writer.println( "\\tableofcontents" );
+// writer.println( "\\listoffigures" );
for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
{
@@ -166,17 +179,26 @@
SectionInfo info = (SectionInfo) sectionInfos.get( section.getId() );
- writer.println( "\\input{" + info.id + "}");
+ writer.println( "\\input{" + info.id + "}" );
}
}
- writer.println( "\\end{document}");
+ writer.println( "\\end{document}" );
}
+ /**
+ * Write a section.
+ *
+ * @param section the Section to write.
+ * @param context the BookContext.
+ * @return SectionInfo
+ * @throws IOException if any.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
private SectionInfo writeSection( Section section, BookContext context )
throws IOException, BookDoxiaException
{
- File file = new File( context.getOutputDirectory(), (section.getId() + ".tex") );
+ File file = new File( context.getOutputDirectory(), ( section.getId() + ".tex" ) );
FileWriter writer = new FileWriter( file );
@@ -186,7 +208,8 @@
if ( bookFile == null )
{
- throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ throw new BookDoxiaException( "No document that matches section with id="
+ + section.getId() + "." );
}
try
@@ -195,15 +218,18 @@
}
catch ( ParserNotFoundException e )
{
- throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+ throw new BookDoxiaException( "Parser not found: "
+ + bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
- throw new BookDoxiaException( "Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ throw new BookDoxiaException( "Error while parsing document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( FileNotFoundException e )
{
- throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ throw new BookDoxiaException( "Could not find document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
}
SectionInfo info = new SectionInfo();
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -37,17 +37,13 @@
public class PdfBookRenderer
extends AbstractITextBookRenderer
{
- /**
- * @see org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer#getOutputExtension()
- */
+ /** {@inheritDoc} */
public String getOutputExtension()
{
return "pdf";
}
- /**
- * @see org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer#renderXML(java.io.File, java.io.File)
- */
+ /** {@inheritDoc} */
public void renderXML( File iTextFile, File iTextOutput )
throws IOException
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -37,17 +37,13 @@
public class RtfBookRenderer
extends AbstractITextBookRenderer
{
- /**
- * @see org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer#getOutputExtension()
- */
+ /** {@inheritDoc} */
public String getOutputExtension()
{
return "rtf";
}
- /**
- * @see org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer#renderXML(java.io.File, java.io.File)
- */
+ /** {@inheritDoc} */
public void renderXML( File iTextFile, File iTextOutput )
throws IOException
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -52,6 +52,7 @@
// BookRenderer Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void renderBook( BookContext context )
throws BookDoxiaException
{
@@ -61,7 +62,8 @@
{
if ( !context.getOutputDirectory().mkdirs() )
{
- throw new BookDoxiaException( "Could not make directory: " + context.getOutputDirectory().getAbsolutePath() + "." );
+ throw new BookDoxiaException( "Could not make directory: "
+ + context.getOutputDirectory().getAbsolutePath() + "." );
}
}
@@ -79,9 +81,10 @@
}
PrettyPrintXMLWriter writer = new PrettyPrintXMLWriter( fileWriter );
- writer.writeText( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">" );
+ writer.writeText(
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">" );
writer.startElement( "html" );
- writer.addAttribute( "xmlns", "http://www.w3.org/1999/xhtml");
+ writer.addAttribute( "xmlns", "http://www.w3.org/1999/xhtml" );
writer.startElement( "body" );
for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
@@ -108,6 +111,14 @@
// Private
// ----------------------------------------------------------------------
+ /**
+ * Write a chapter.
+ *
+ * @param writer the writer.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
private void renderChapter( PrettyPrintXMLWriter writer, Chapter chapter, BookContext context )
throws BookDoxiaException
{
@@ -123,6 +134,14 @@
writer.endElement();
}
+ /**
+ * Write a section.
+ *
+ * @param writer the writer.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
private void renderSection( PrettyPrintXMLWriter writer, Section section, BookContext context )
throws BookDoxiaException
{
@@ -143,7 +162,8 @@
//
// ----------------------------------------------------------------------
-// Sink sink = new XhtmlSink( writer, new RenderingContext( context.getOutputDirectory(), bookFile.getFile().getAbsolutePath() ) );
+// Sink sink = new XhtmlSink( writer,
+// new RenderingContext( context.getOutputDirectory(), bookFile.getFile().getAbsolutePath() ) );
// try
// {
@@ -151,15 +171,18 @@
// }
// catch ( ParserNotFoundException e )
// {
-// throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+// throw new BookDoxiaException( "Parser not found: "
+// + bookFile.getParserId() + ".", e );
// }
// catch ( ParseException e )
// {
-// throw new BookDoxiaException( "Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+// throw new BookDoxiaException( "Error while parsing document: "
+// + bookFile.getFile().getAbsolutePath() + ".", e );
// }
// catch ( FileNotFoundException e )
// {
-// throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+// throw new BookDoxiaException( "Could not find document: "
+// + bookFile.getFile().getAbsolutePath() + ".", e );
// }
writer.endElement();
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java Wed Sep 5 07:22:50 2007
@@ -75,6 +75,7 @@
// BookRenderer Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public void renderBook( BookContext context )
throws BookDoxiaException
{
@@ -101,7 +102,6 @@
*
* @param key the key for the desired string
* @return the string for the given key
- * @throws IllegalArgumentException if the parameter is empty.
*/
protected String getString( String key )
{
@@ -121,8 +121,8 @@
/**
* Render the book, ie the book index and all chapter index and pages
*
- * @param book
- * @param context
+ * @param book the BookModel.
+ * @param context the BookContext.
* @throws BookDoxiaException if any
*/
private void renderBook( BookModel book, BookContext context )
@@ -140,7 +140,8 @@
}
catch ( IOException e )
{
- throw new BookDoxiaException( "Error while rendering index page to: '" + index.getAbsolutePath() + "'.", e );
+ throw new BookDoxiaException( "Error while rendering index page to: '"
+ + index.getAbsolutePath() + "'.", e );
}
// -----------------------------------------------------------------------
@@ -158,11 +159,11 @@
}
/**
- * Write the book index, ie a TOC
+ * Write the book index, ie a TOC.
*
- * @param index
- * @param book
- * @param context
+ * @param index the File.
+ * @param book the BookModel.
+ * @param context the BookContext.
* @throws IOException if any
*/
private void writeBookIndex( File index, BookModel book, BookContext context )
@@ -208,10 +209,10 @@
}
/**
- * Write the chapter index for the book index
+ * Write the chapter index for the book index.
*
- * @param sink
- * @param chapterEntry
+ * @param sink the XdocSink.
+ * @param chapterEntry the chapter IndexEntry.
*/
private void writeChapterIndexForBookIndex( XdocSink sink, IndexEntry chapterEntry )
{
@@ -232,10 +233,10 @@
}
/**
- * Write the section index for the book index
+ * Write the section index for the book index.
*
- * @param sink
- * @param sectionIndex
+ * @param sink the XdocSink.
+ * @param sectionIndex the section IndexEntry.
*/
private void writeSectionIndexForBookIndex( XdocSink sink, IndexEntry sectionIndex )
{
@@ -256,11 +257,11 @@
}
/**
- * Write subsection index for the book index
+ * Write subsection index for the book index.
*
- * @param sink
- * @param sectionIndex
- * @param subsectionIndex
+ * @param sink the XdocSink.
+ * @param sectionIndex the section IndexEntry.
+ * @param subsectionIndex the subsection IndexEntry.
*/
private void writeSubsectionIndexForBookIndex( XdocSink sink, IndexEntry sectionIndex, IndexEntry subsectionIndex )
{
@@ -276,11 +277,11 @@
// -----------------------------------------------------------------------
/**
- * Render the chapter index and all section pages
+ * Render the chapter index and all section pages.
*
- * @param chapter
- * @param context
- * @param chapterIndex
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @param chapterIndex the IndexEntry.
* @throws BookDoxiaException if any
*/
private void renderChapter( Chapter chapter, BookContext context, IndexEntry chapterIndex )
@@ -298,7 +299,8 @@
}
catch ( IOException e )
{
- throw new BookDoxiaException( "Error while rendering index page to: '" + index.getAbsolutePath() + "'.", e );
+ throw new BookDoxiaException( "Error while rendering index page to: '"
+ + index.getAbsolutePath() + "'.", e );
}
// -----------------------------------------------------------------------
@@ -318,10 +320,10 @@
/**
* Write a chapter index
*
- * @param index
- * @param chapter
- * @param chapterIndex
- * @throws IOException
+ * @param index the File.
+ * @param chapter the Chapter.
+ * @param chapterIndex the IndexEntry.
+ * @throws IOException if any.
*/
private void writeChapterIndex( File index, Chapter chapter, IndexEntry chapterIndex )
throws IOException
@@ -367,12 +369,12 @@
}
/**
- * Render all section pages
+ * Render all section pages.
*
- * @param context
- * @param section
- * @param sectionIndex
- * @throws BookDoxiaException if any
+ * @param context the BookContext.
+ * @param section the Section.
+ * @param sectionIndex the IndexEntry.
+ * @throws BookDoxiaException if any.
*/
private void renderSection( BookContext context, Section section, IndexEntry sectionIndex )
throws BookDoxiaException
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java Wed Sep 5 07:22:50 2007
@@ -22,7 +22,6 @@
import org.apache.maven.doxia.module.latex.LatexSink;
import java.io.Writer;
-import java.io.IOException;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -31,14 +30,22 @@
public class LatexBookSink
extends LatexSink
{
+ /** text. */
private String text;
+ /** title. */
private String title;
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
+ /**
+ * Construct a new LatexBookSink which is a LatexSink with the given writer,
+ * null sinkCommands, null preamble and fragmentDocument = true.
+ *
+ * @param out the writer for the sink.
+ */
public LatexBookSink( Writer out )
{
super( out, null, null, true );
@@ -48,12 +55,14 @@
//
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
protected String getDocumentStart()
{
return "";
// return "\\documentclass{book}";
}
+ /** {@inheritDoc} */
protected String getDocumentBegin()
{
return null;
@@ -63,13 +72,15 @@
//
// ----------------------------------------------------------------------
- public void text( String text )
+ /** {@inheritDoc} */
+ public void text( String newText )
{
- this.text = text;
+ this.text = newText;
super.text( text );
}
+ /** {@inheritDoc} */
public void title_()
{
super.title_();
@@ -81,6 +92,11 @@
//
// ----------------------------------------------------------------------
+ /**
+ * Return the title.
+ *
+ * @return String.
+ */
public String getTitle()
{
return title;
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java Wed Sep 5 07:22:50 2007
@@ -36,13 +36,14 @@
public abstract class AbstractXdocBookSink
extends XdocSink
{
+ /** I18N for localized messages. */
private I18N i18n;
/**
- * Default constructor
+ * Default constructor.
*
- * @param out
- * @param i18n
+ * @param out a Writer.
+ * @param i18n I18N.
*/
public AbstractXdocBookSink( Writer out, I18N i18n )
{
@@ -153,7 +154,6 @@
*
* @param key the key for the desired string
* @return the string for the given key
- * @throws IllegalArgumentException if the parameter is empty.
*/
protected String getString( String key )
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java Wed Sep 5 07:22:50 2007
@@ -25,7 +25,7 @@
import org.codehaus.plexus.i18n.I18N;
/**
- * A <code>XdocSink</code> implementation for chapter in a book
+ * A <code>XdocSink</code> implementation for chapter in a book.
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
@@ -33,14 +33,15 @@
public class ChapterXdocBookSink
extends AbstractXdocBookSink
{
+ /** the chapter IndexEntry. */
private IndexEntry chapterIndex;
/**
- * Default constructor
+ * Default constructor.
*
- * @param out
- * @param chapterIndex
- * @param i18n
+ * @param out the Writer.
+ * @param chapterIndex the chapter IndexEntry.
+ * @param i18n I18N.
*/
public ChapterXdocBookSink( Writer out, IndexEntry chapterIndex, I18N i18n )
{
@@ -96,9 +97,9 @@
}
/**
- * Add previous link
+ * Add previous link.
*
- * @param prevChapter
+ * @param prevChapter the previous IndexEntry.
*/
protected void previous( IndexEntry prevChapter )
{
@@ -123,9 +124,7 @@
}
/**
- * Add parent/up link
- *
- * @param parent
+ * Add parent/up link.
*/
protected void up()
{
@@ -134,8 +133,6 @@
/**
* Add next link
- *
- * @param nextChapter
*/
protected void next()
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java Wed Sep 5 07:22:50 2007
@@ -34,14 +34,15 @@
public class IndexXdocBookSink
extends AbstractXdocBookSink
{
+ /** the first IndexEntry. */
private IndexEntry firstEntry;
/**
- * Default constructor
+ * Default constructor.
*
- * @param out
- * @param firstEntry
- * @param i18n
+ * @param out the Writer.
+ * @param firstEntry the first IndexEntry.
+ * @param i18n I18N.
*/
public IndexXdocBookSink( Writer out, IndexEntry firstEntry, I18N i18n )
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java Wed Sep 5 07:22:50 2007
@@ -33,14 +33,15 @@
public class SectionXdocBookSink
extends AbstractXdocBookSink
{
+ /** indexEntry. */
private IndexEntry indexEntry;
/**
- * Default constructor
+ * Default constructor.
*
- * @param out
- * @param indexEntry
- * @param i18n
+ * @param out the Writer to use.
+ * @param indexEntry the IndexEntry.
+ * @param i18n the I18N.
*/
public SectionXdocBookSink( Writer out, IndexEntry indexEntry, I18N i18n )
{
@@ -100,10 +101,10 @@
}
/**
- * Add previous link
+ * Add previous link.
*
- * @param parent
- * @param prevEntry
+ * @param parent the parent IndexEntry.
+ * @param prevEntry the previous IndexEntry.
*/
protected void previous( IndexEntry parent, IndexEntry prevEntry )
{
@@ -122,6 +123,9 @@
}
/**
+ * Add parent/up link.
+ *
+ * @param parent the parent IndexEntry.
* @see org.apache.maven.doxia.book.services.renderer.xdoc.ChapterXdocBookSink#up(org.apache.maven.doxia.book.context.IndexEntry)
*/
protected void up( IndexEntry parent )
@@ -130,10 +134,10 @@
}
/**
- * Add next link
+ * Add next link.
*
- * @param parent
- * @param nextEntry
+ * @param parent the parent IndexEntry.
+ * @param nextEntry the next IndexEntry.
*/
protected void next( IndexEntry parent, IndexEntry nextEntry )
{
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java Wed Sep 5 07:22:50 2007
@@ -22,12 +22,21 @@
import org.apache.maven.doxia.book.model.BookModel;
/**
+ * Ensure a BookModel is valid.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public interface BookValidator
{
+ /** The plexus lookup role. */
String ROLE = BookValidator.class.getName();
+ /**
+ * Validate a BookModel.
+ *
+ * @param book the BookModel to validate.
+ * @return ValidationResult
+ */
ValidationResult validateBook( BookModel book );
}
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java Wed Sep 5 07:22:50 2007
@@ -27,6 +27,8 @@
import java.util.Iterator;
/**
+ * Default implementation of BookValidator.
+ *
* @plexus.component
*
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
@@ -40,6 +42,7 @@
// BookValidator Implementation
// ----------------------------------------------------------------------
+ /** {@inheritDoc} */
public ValidationResult validateBook( BookModel book )
{
ValidationResult result = new ValidationResult();
@@ -77,6 +80,12 @@
// Private
// ----------------------------------------------------------------------
+ /**
+ * Validate a Chapter.
+ *
+ * @param result the ValidationResult to receive the results.
+ * @param chapter the chapter to validate.
+ */
private void validateChapter( ValidationResult result, Chapter chapter )
{
if ( StringUtils.isEmpty( chapter.getId() ) )
Modified: maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java?rev=572956&r1=572955&r2=572956&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java (original)
+++ maven/sandbox/trunk/doxia/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java Wed Sep 5 07:22:50 2007
@@ -23,22 +23,37 @@
import java.util.ArrayList;
/**
+ * Encapsulates the result of a validation.
+ *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
public class ValidationResult
{
+ /** If all is OK. */
private boolean allOk;
+ /** List of errors. */
private List errors;
+ /** List of warnings. */
private List warnings;
+ /**
+ * Checks if there were any errors or warnings.
+ *
+ * @return True if there were no errors or warnings.
+ */
public boolean isAllOk()
{
return getErrors().size() == 0 && getWarnings().size() == 0;
}
+ /**
+ * Return the list of errors.
+ *
+ * @return List. A new ArrayList is constructed if the current List is null.
+ */
public List getErrors()
{
if ( errors == null )
@@ -49,6 +64,11 @@
return errors;
}
+ /**
+ * Return the list of warnings.
+ *
+ * @return List. A new ArrayList is constructed if the current List is null.
+ */
public List getWarnings()
{
if ( warnings == null )