in src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java [183:222]
private void renderSection( Section section, BookContext context, Sink sink )
throws BookDoxiaException
{
BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
}
catch ( ParseException 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 );
}
catch ( IOException e )
{
throw new BookDoxiaException( "Error while rendering book: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
finally
{
IOUtil.close( reader );
}
}