|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdochelper.DocumentSection
public class DocumentSection
The class DocumentSection
implements the member classes in
DocHelper can use to encapsulate content.
Field Summary | |
---|---|
private java.lang.String |
end
Document Sections: Start. |
private static int |
END_LEN
Length of ||END||. |
java.util.Map |
params
Params for the docsection. |
private java.lang.String |
start
Document Sections: Start. |
private static int |
START_LEN
Length of ||START||. |
Constructor Summary | |
---|---|
DocumentSection(java.io.File docRef)
Create an instance of DocumentSection using a
reference to a sfile. |
|
DocumentSection(java.io.File docRef,
java.util.Map params)
Create an instance of DocumentSection using a reference
to a file. |
|
DocumentSection(java.lang.String start,
java.lang.String end)
Create a DocumentSection instance using literal Values. |
Method Summary | |
---|---|
private java.lang.String |
applyParams(java.lang.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]); |
java.lang.String |
getEND()
Get the End of this Document Section |
java.lang.String |
getSTART()
Get the Start of the Document Section |
void |
setParams(java.util.Map params)
Set the parameters Map for this document section. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String start
private final java.lang.String end
private static final int START_LEN
private static final int END_LEN
public java.util.Map params
Constructor Detail |
---|
public DocumentSection(java.lang.String start, java.lang.String end)
DocumentSection
instance using literal Values.
start
- a String that will be the start of this Document Sectionend
- a String that will be the end of this Document Sectionpublic DocumentSection(java.io.File docRef) throws java.io.FileNotFoundException, java.io.IOException
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
java.io.FileNotFoundException
java.io.IOException
public DocumentSection(java.io.File docRef, java.util.Map params) throws java.lang.Exception
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
Method Detail |
---|
public void setParams(java.util.Map params)
params
- The parameter map used for this document section.public java.lang.String getSTART()
public java.lang.String getEND()
private java.lang.String applyParams(java.lang.String in)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |