Class AbstractDocumentRenderer
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.doxia.docrenderer.AbstractDocumentRenderer
- All Implemented Interfaces:
DocumentRenderer
,org.codehaus.plexus.logging.LogEnabled
- Direct Known Subclasses:
AbstractPdfRenderer
@Deprecated
public abstract class AbstractDocumentRenderer
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements DocumentRenderer
Deprecated.
Abstract
document
renderer.- Since:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Deprecated.The common base directory of source files.protected org.apache.maven.doxia.Doxia
Deprecated.protected org.apache.maven.doxia.parser.module.ParserModuleManager
Deprecated.private org.codehaus.plexus.velocity.VelocityComponent
Deprecated.Fields inherited from interface org.apache.maven.doxia.docrenderer.DocumentRenderer
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
copyDirectory
(File source, File destination) Deprecated.Copy content of a directory, excluding scm-specific files.protected void
copyResources
(File outputDirectory) Deprecated.Copies the contents of the resource directory to an output folder.protected static boolean
endsWithIgnoreCase
(String str, String searchStr) Deprecated.protected static boolean
endsWithIgnoreCase
(String str, String[] searchStrs) Deprecated.Deprecated.Return the current base directory.protected static String[]
getExtensions
(org.apache.maven.doxia.parser.module.ParserModule module) Deprecated.getFilesToProcess
(File baseDirectory) Deprecated.Returns a Map of files to process.getFilesToProcess
(Collection<String> files) Deprecated.Returns a Map of files to process.protected String
getOutputName
(org.apache.maven.doxia.document.DocumentModel documentModel) Deprecated.private Reader
getVelocityReader
(File f, String encoding, DocumentRendererContext context) Deprecated.TODO: DOXIA-111: we need a general filter here that knows how to alter the contextprivate static boolean
Deprecated.protected void
Deprecated.protected void
parse
(String fullDocPath, String parserId, org.apache.maven.doxia.sink.Sink sink, DocumentRendererContext context) Deprecated.Parse a source document into a sink.org.apache.maven.doxia.document.DocumentModel
readDocumentModel
(File documentDescriptor) Deprecated.Read a document model from a file.void
Deprecated.Render a document from the files found in baseDirectory.void
Deprecated.Render a document from the files found in baseDirectory.void
render
(File baseDirectory, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) Deprecated.Render a document from the files found in a source directory, depending on a rendering context.void
render
(File baseDirectory, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel, DocumentRendererContext context) Deprecated.Render a document from the files found in a source directory, depending on a rendering context.void
render
(Collection<String> files, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) Deprecated.Render a document from a set of files, depending on a rendering context.abstract void
render
(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) Deprecated.since 1.1.2, userender(Map, File, DocumentModel, DocumentRendererContext)
void
render
(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel, DocumentRendererContext context) Deprecated.Render an aggregate document from the files found in a Map.void
renderIndividual
(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory) Deprecated.since 1.1.2, userenderIndividual(Map, File, DocumentRendererContext)
void
renderIndividual
(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, DocumentRendererContext context) Deprecated.Render documents separately for each file found in a Map.void
setBaseDir
(String newDir) Deprecated.Sets the current base directory.private Reader
Deprecated.Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.doxia.docrenderer.DocumentRenderer
getOutputExtension
-
Field Details
-
parserModuleManager
@Requirement protected org.apache.maven.doxia.parser.module.ParserModuleManager parserModuleManagerDeprecated. -
doxia
@Requirement protected org.apache.maven.doxia.Doxia doxiaDeprecated. -
velocity
@Requirement private org.codehaus.plexus.velocity.VelocityComponent velocityDeprecated. -
baseDir
Deprecated.The common base directory of source files.
-
-
Constructor Details
-
AbstractDocumentRenderer
public AbstractDocumentRenderer()Deprecated.
-
-
Method Details
-
render
public abstract void render(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) throws DocumentRendererException, IOExceptionDeprecated.since 1.1.2, userender(Map, File, DocumentModel, DocumentRendererContext)
Render an aggregate document from the files found in a Map.- Parameters:
filesToProcess
- the Map of Files to process. The Map should contain as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.outputDirectory
- the output directory where the aggregate document should be generated.documentModel
- the document model, containing all the metadata, etc.- Throws:
DocumentRendererException
- if anyIOException
- if any
-
render
public void render(Collection<String> files, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) throws DocumentRendererException, IOException Deprecated.Render a document from a set of files, depending on a rendering context.- Specified by:
render
in interfaceDocumentRenderer
- Parameters:
files
- the path name Strings (relative to a common base directory) of files to include in the document generation.outputDirectory
- the output directory where the document should be generated.documentModel
- the document model, containing all the metadata, etc. If the model contains a TOC, only the files found in this TOC are rendered, otherwise all files from the Collection of files will be processed. If the model is null, render all files individually.- Throws:
DocumentRendererException
- if any.IOException
- if any.
-
render
public void render(File baseDirectory, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel) throws DocumentRendererException, IOException Deprecated.Render a document from the files found in a source directory, depending on a rendering context.- Specified by:
render
in interfaceDocumentRenderer
- Parameters:
baseDirectory
- the directory containing the source files. This should follow the standard Maven convention, ie containing all the site modules.outputDirectory
- the output directory where the document should be generated.documentModel
- the document model, containing all the metadata, etc. If the model contains a TOC, only the files found in this TOC are rendered, otherwise all files found under baseDirectory will be processed. If the model is null, render all files from baseDirectory individually.- Throws:
DocumentRendererException
- if anyIOException
- if any
-
render
public void render(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel, DocumentRendererContext context) throws DocumentRendererException, IOExceptionDeprecated.Render an aggregate document from the files found in a Map.- Parameters:
filesToProcess
- the Map of Files to process. The Map should contain as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.outputDirectory
- the output directory where the aggregate document should be generated.documentModel
- the document model, containing all the metadata, etc.context
- the rendering context when processing files.- Throws:
DocumentRendererException
- if anyIOException
- if any
-
render
public void render(File baseDirectory, File outputDirectory, org.apache.maven.doxia.document.DocumentModel documentModel, DocumentRendererContext context) throws DocumentRendererException, IOException Deprecated.Render a document from the files found in a source directory, depending on a rendering context.- Parameters:
baseDirectory
- the directory containing the source files. This should follow the standard Maven convention, ie containing all the site modules.outputDirectory
- the output directory where the document should be generated.documentModel
- the document model, containing all the metadata, etc. If the model contains a TOC, only the files found in this TOC are rendered, otherwise all files found under baseDirectory will be processed. If the model is null, render all files from baseDirectory individually.context
- the rendering context when processing files.- Throws:
DocumentRendererException
- if anyIOException
- if any- Since:
- 1.1.2
-
render
public void render(File baseDirectory, File outputDirectory) throws DocumentRendererException, IOException Deprecated.Render a document from the files found in baseDirectory. This just forwards torender(File,File,DocumentModel)
with a new DocumentModel.- Parameters:
baseDirectory
- the directory containing the source files. This should follow the standard Maven convention, ie containing all the site modules.outputDirectory
- the output directory where the document should be generated.- Throws:
DocumentRendererException
- if anyIOException
- if any- See Also:
-
render
public void render(File baseDirectory, File outputDirectory, File documentDescriptor) throws DocumentRendererException, IOException Deprecated.Render a document from the files found in baseDirectory.- Parameters:
baseDirectory
- the directory containing the source files. This should follow the standard Maven convention, ie containing all the site modules.outputDirectory
- the output directory where the document should be generated.documentDescriptor
- a file containing the document model. If this file does not exist or is null, some default settings will be used.- Throws:
DocumentRendererException
- if anyIOException
- if any- See Also:
-
renderIndividual
public void renderIndividual(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory) throws DocumentRendererException, IOExceptionDeprecated.since 1.1.2, userenderIndividual(Map, File, DocumentRendererContext)
Render documents separately for each file found in a Map.- Parameters:
filesToProcess
- the Map of Files to process. The Map should contain as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.outputDirectory
- the output directory where the documents should be generated.- Throws:
DocumentRendererException
- if anyIOException
- if any- Since:
- 1.1.1
-
renderIndividual
public void renderIndividual(Map<String, org.apache.maven.doxia.parser.module.ParserModule> filesToProcess, File outputDirectory, DocumentRendererContext context) throws DocumentRendererException, IOExceptionDeprecated.Render documents separately for each file found in a Map.- Parameters:
filesToProcess
- the Map of Files to process. The Map should contain as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.outputDirectory
- the output directory where the documents should be generated.context
- the rendering context.- Throws:
DocumentRendererException
- if anyIOException
- if any- Since:
- 1.1.2
-
getFilesToProcess
public Map<String,org.apache.maven.doxia.parser.module.ParserModule> getFilesToProcess(File baseDirectory) throws IOException, DocumentRendererException Deprecated.Returns a Map of files to process. The Map contains as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.- Parameters:
baseDirectory
- the directory containing the source files. This should follow the standard Maven convention, ie containing all the site modules.- Returns:
- a Map of files to process.
- Throws:
IOException
- in case of a problem reading the files under baseDirectory.DocumentRendererException
- if any
-
getExtensions
Deprecated. -
endsWithIgnoreCase
Deprecated. -
endsWithIgnoreCase
Deprecated. -
getFilesToProcess
public Map<String,org.apache.maven.doxia.parser.module.ParserModule> getFilesToProcess(Collection<String> files) Deprecated.Returns a Map of files to process. The Map contains as keys the paths of the source files (relative tobaseDir
), and the corresponding ParserModule as values.- Parameters:
files
- The Collection of source files.- Returns:
- a Map of files to process.
-
readDocumentModel
public org.apache.maven.doxia.document.DocumentModel readDocumentModel(File documentDescriptor) throws DocumentRendererException, IOException Deprecated.Read a document model from a file.- Specified by:
readDocumentModel
in interfaceDocumentRenderer
- Parameters:
documentDescriptor
- a document descriptor file that contains the document model.- Returns:
- the document model, containing all the metadata, etc.
- Throws:
DocumentRendererException
- if anyIOException
- if any
-
setBaseDir
Deprecated.Sets the current base directory.- Parameters:
newDir
- the absolute path to the base directory to set.
-
getBaseDir
Deprecated.Return the current base directory.- Returns:
- the current base directory.
-
parse
protected void parse(String fullDocPath, String parserId, org.apache.maven.doxia.sink.Sink sink) throws DocumentRendererException, IOException Deprecated.since 1.1.2, useparse(String, String, Sink, DocumentRendererContext)
Parse a source document into a sink.- Parameters:
fullDocPath
- absolute path to the source document.parserId
- determines the parser to use.sink
- the sink to receive the events.- Throws:
DocumentRendererException
- in case of a parsing error.IOException
- if the source document cannot be opened.
-
parse
protected void parse(String fullDocPath, String parserId, org.apache.maven.doxia.sink.Sink sink, DocumentRendererContext context) throws DocumentRendererException, IOException Deprecated.Parse a source document into a sink.- Parameters:
fullDocPath
- absolute path to the source document.parserId
- determines the parser to use.sink
- the sink to receive the events.context
- the rendering context.- Throws:
DocumentRendererException
- in case of a parsing error.IOException
- if the source document cannot be opened.
-
copyResources
Deprecated.Copies the contents of the resource directory to an output folder.- Parameters:
outputDirectory
- the destination folder.- Throws:
IOException
- if any.
-
copyDirectory
Deprecated.Copy content of a directory, excluding scm-specific files.- Parameters:
source
- directory that contains the files and sub-directories to be copied.destination
- destination folder.- Throws:
IOException
- if any.
-
getOutputName
Deprecated.- Parameters:
documentModel
- not null- Returns:
- the output name defined in the documentModel without the output extension. If the output name is not defined, return target by default.
- Since:
- 1.1.1
- See Also:
-
getVelocityReader
private Reader getVelocityReader(File f, String encoding, DocumentRendererContext context) throws DocumentRendererException Deprecated.TODO: DOXIA-111: we need a general filter here that knows how to alter the context- Parameters:
f
- the file to process, not nullencoding
- the wanted encoding, not nullcontext
- the current render document context not null- Returns:
- a reader with
- Throws:
DocumentRendererException
-
isVelocityFile
Deprecated.- Parameters:
f
- not null- Returns:
true
if file has a vm extension,false otherwise.
-
validate
private Reader validate(Reader source, String resource) throws org.apache.maven.doxia.parser.ParseException, IOException Deprecated.- Throws:
org.apache.maven.doxia.parser.ParseException
IOException
-
parse(String, String, Sink, DocumentRendererContext)