|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.doc.HtmlDocGenerator
public class HtmlDocGenerator
This class generates an HTML doc based on HTML templates and text files for the content.
The goal is to programmatically realize something like a client-side include for HTML documents.
The templates are place holders inserted within the HTML code. They can hold parameters to make
them more generic and resusable.
A template can be nested within another template.
Rationale: HTML docs often contain more code for the visual rendering of the content than
for the content itself. For example, using rounded tables holding the actual content implies a
lot of additional table constructs and ends up cluttering the code. This makes the documentation
difficult to maintain.
This implementation provides a means to leave the additional rendering constructs
in separate files, with the double benefit of making the doc easier to author, read and maintain,
and making it possible to reuse the visual effects easily.
| Field Summary | |
|---|---|
static String |
COMMENT
Start of a template line comment. |
static String |
CONTENT_END
End of a content parameter value. |
static String |
CONTENT_START
Start of a content parameter value. |
static String |
EQUALS
Separator for parameter name/value pair. |
static String |
PARAM_END
End of a template parameter placeholder. |
static String |
PARAM_START
Start of a template parameter placeholder. |
static String |
QUOTE
Enclosing sequence for parameter values. |
static String |
TEMPLATE_END
End of a template insertion. |
static String |
TEMPLATE_START
Start of a template insertion. |
| Constructor Summary | |
|---|---|
HtmlDocGenerator()
|
|
| Method Summary | |
|---|---|
void |
generatePage(String source,
String target,
String templateFolder)
Generate a target HTML document for a document source, using a specified location for the templates to use. |
static void |
main(String... args)
Test this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TEMPLATE_START
public static final String TEMPLATE_END
public static final String CONTENT_START
public static final String CONTENT_END
public static final String EQUALS
public static final String QUOTE
public static final String COMMENT
public static final String PARAM_START
public static final String PARAM_END
| Constructor Detail |
|---|
public HtmlDocGenerator()
| Method Detail |
|---|
public void generatePage(String source,
String target,
String templateFolder)
throws Exception
source - the source document.target - the target HTML document.templateFolder - the location of the templates.
Exception - if any error occurs while reading, parsing or writing any of the files.public static void main(String... args)
args - the options to use.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||