DocumentSection
implements the member classes in DocHelper can use to encapsulate content.
More...
Public Member Functions | |
DocumentSection (final String start, final String end) | |
Create a DocumentSection instance using literal Values. | |
DocumentSection (final File docRef) throws FileNotFoundException, IOException | |
Create an instance of DocumentSection using a reference to a sfile. | |
DocumentSection (final File docRef, final Map params) throws Exception | |
Create an instance of DocumentSection using a reference to a file. | |
void | setParams (Map params) |
Set the parameters Map for this document section. | |
String | getSTART () |
Get the Start of the Document Section. | |
String | getEND () |
Get the End of this Document Section. | |
Public Attributes | |
Map | params |
Params for the docsection. | |
Private Member Functions | |
String | applyParams (String in) |
For the key set within the params Map , this method will look for $[key] within in and replace it with the return of params.get([key]);. | |
Private Attributes | |
final String | start |
Document Sections: Start. | |
final String | end |
Document Sections: Start. | |
Static Private Attributes | |
static final int | START_LEN = 9 |
Length of ||START||. | |
static final int | END_LEN = 7 |
Length of ||END||. |
DocumentSection
implements the member classes in DocHelper can use to encapsulate content.
Definition at line 25 of file DocumentSection.java.
dochelper.DocumentSection.DocumentSection | ( | final String | start, | |
final String | end | |||
) |
Create a DocumentSection
instance using literal Values.
start | a String that will be the start of this Document Section | |
end | a String that will be the end of this Document Section |
Definition at line 63 of file DocumentSection.java.
dochelper.DocumentSection.DocumentSection | ( | final File | docRef | ) | throws FileNotFoundException, IOException |
Create an instance of DocumentSection
using a reference to a sfile.
The Format of the file must be :
||START|| Content (may be multiline) ||END|| Content (may be multiline)
docRef | File reference of template to use. |
java.lang.Exception |
Definition at line 79 of file DocumentSection.java.
dochelper.DocumentSection.DocumentSection | ( | final File | docRef, | |
final Map | params | |||
) | throws Exception |
Create an instance of DocumentSection
using a reference to a file.
The Format of the file must be :
||START|| Content (may be multiline) ||END|| Content (may be multiline)
docRef | File reference of template to use. | |
params | a Map that hold the dynamic values to replace within the start and end sections |
java.lang.Exception |
Definition at line 115 of file DocumentSection.java.
void dochelper.DocumentSection.setParams | ( | Map | params | ) |
Set the parameters Map for this document section.
params | The parameter map used for this document section. |
Definition at line 125 of file DocumentSection.java.
String dochelper.DocumentSection.getSTART | ( | ) |
Get the Start of the Document Section.
Definition at line 134 of file DocumentSection.java.
String dochelper.DocumentSection.getEND | ( | ) |
Get the End of this Document Section.
Definition at line 143 of file DocumentSection.java.
String dochelper.DocumentSection.applyParams | ( | String | in | ) | [private] |
For the key set within the params Map
, this method will look for $[key] within in
and replace it with the return of params.get([key]);.
in | String to be processed |
Definition at line 158 of file DocumentSection.java.
final String dochelper.DocumentSection.start [private] |
final String dochelper.DocumentSection.end [private] |
final int dochelper.DocumentSection.START_LEN = 9 [static, private] |
final int dochelper.DocumentSection.END_LEN = 7 [static, private] |
Params for the docsection.
Parameters may be passed to a Document Section object in order to define "hooks" that may be replaced with parameter values. The Start and End sections may need to contain specific information that may be provided by the object that is utilizing this DocSection like: Filename, Tablename, path, etc.
For a key set within the params Map, a Document section will look for $[key] within its text (start or end) and replace it with the return of params.get([key]);
Definition at line 53 of file DocumentSection.java.