Class RenderingContext
java.lang.Object
org.apache.maven.doxia.siterenderer.RenderingContext
The rendering context of a document.
If not rendered from a Doxia markup source, parserId and extension will be null.
- Since:
- 1.5 (was since 1.1 in o.a.m.d.sink.render)
- Author:
- Jason van Zyl
-
Constructor Summary
ConstructorsConstructorDescriptionRenderingContext
(File basedir, String document) Deprecated.RenderingContext
(File basedir, String document, String generator) Constructor for RenderingContext when document is not rendered from a Doxia markup source.RenderingContext
(File basedir, String document, String parserId, String extension) Deprecated.RenderingContext
(File basedir, String basedirRelativePath, String document, String parserId, String extension, boolean editable) RenderingContext
(File basedir, String basedirRelativePath, String document, String parserId, String extension, boolean editable, String generator) Constructor for document RenderingContext. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String key) getAttribute.Getter for the fieldbasedir
.Get the relative path of basedir (when a Doxia source)Get the relative path to Doxia source from build root.getDoxiaSourcePath
(String base) Get url of the Doxia source calculate from given base url.Get the source document filename extension (when a Doxia source)What is the generator (if any)?Getter for the fieldinputName
.Get html output name, relative to site root.Get the parserId when document comes from a Doxia source.Get the relative path to site root.boolean
Is the document rendered from a Doxia source?boolean
Is the source document editable?void
setAttribute
(String key, String value) setAttribute.
-
Constructor Details
-
RenderingContext
Deprecated. -
RenderingContext
Constructor for RenderingContext when document is not rendered from a Doxia markup source.
- Parameters:
basedir
- the pseudo-source base directory.document
- the pseudo-source document name: will be used to compute output name (same name with extension replaced with.html
).generator
- the generator (in general a reporting goal:groupId:artifactId:version:goal
)- Since:
- 1.8
-
RenderingContext
@Deprecated public RenderingContext(File basedir, String document, String parserId, String extension) Deprecated. -
RenderingContext
-
RenderingContext
public RenderingContext(File basedir, String basedirRelativePath, String document, String parserId, String extension, boolean editable, String generator) Constructor for document RenderingContext.
- Parameters:
basedir
- the source base directory (not null, pseudo value when not a Doxia source).basedirRelativePath
- the relative path from root (null if not Doxia source)document
- the source document name.parserId
- the Doxia module parser id associated to this document, may be null if document not rendered from a Doxia source.extension
- the source document filename extension, may be null if document not rendered from a Doxia source.editable
- is the document editable as source, i.e. not generated?generator
- the generator (in general a reporting goal:groupId:artifactId:version:goal
)- Since:
- 1.8
-
-
Method Details
-
getBasedir
Getter for the field
basedir
.- Returns:
- a
File
object.
-
getInputName
Getter for the field
inputName
.- Returns:
- a
String
object.
-
getOutputName
Get html output name, relative to site root.- Returns:
- html output name
- See Also:
-
getParserId
Get the parserId when document comes from a Doxia source.- Returns:
- parser id, or
null
if not froma DOxia source.
-
getRelativePath
Get the relative path to site root.- Returns:
- the relative path to site root
-
setAttribute
setAttribute.
-
getAttribute
getAttribute.
-
getExtension
Get the source document filename extension (when a Doxia source)- Returns:
- the source document filename extension when a Doxia source, or
null
if not a Doxia source
-
isEditable
public boolean isEditable()Is the source document editable?- Returns:
true
if comes from an editable Doxia source (not generated one).- Since:
- 1.8
-
isDoxiaSource
public boolean isDoxiaSource()Is the document rendered from a Doxia source?- Returns:
true
if comes from a Doxia source.- Since:
- 1.8
-
getGenerator
What is the generator (if any)?- Returns:
null
if no known generator- Since:
- 1.8
-
getBasedirRelativePath
Get the relative path of basedir (when a Doxia source)- Returns:
- the relative path of basedir when a Doxia source, or
null
if not a Doxia source - Since:
- 1.8
-
getDoxiaSourcePath
Get the relative path to Doxia source from build root.- Returns:
- the relative path to Doxia source from build root, or
null
if not a Doxia source - Since:
- 1.8
-
getDoxiaSourcePath
Get url of the Doxia source calculate from given base url.- Parameters:
base
- the base url to use- Returns:
- the resulting url
- Since:
- 1.8
-