dochelper.DocumentSection Class Reference

The class DocumentSection implements the member classes in DocHelper can use to encapsulate content. More...

Collaboration diagram for dochelper.DocumentSection:

Collaboration graph
[legend]

List of all members.

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||.


Detailed Description

The class DocumentSection implements the member classes in DocHelper can use to encapsulate content.

Author:
Guillermo Christen

Definition at line 25 of file DocumentSection.java.


Constructor & Destructor Documentation

dochelper.DocumentSection.DocumentSection ( final String  start,
final String  end 
)

Create a DocumentSection instance using literal Values.

Parameters:
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)

Parameters:
docRef File reference of template to use.
Exceptions:
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)

Parameters:
docRef File reference of template to use.
params a Map that hold the dynamic values to replace within the start and end sections
Exceptions:
java.lang.Exception 

Definition at line 115 of file DocumentSection.java.


Member Function Documentation

void dochelper.DocumentSection.setParams ( Map  params  ) 

Set the parameters Map for this document section.

Parameters:
params The parameter map used for this document section.

Definition at line 125 of file DocumentSection.java.

Here is the caller graph for this function:

String dochelper.DocumentSection.getSTART (  ) 

Get the Start of the Document Section.

Returns:
Start section of this Document Section

Definition at line 134 of file DocumentSection.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String dochelper.DocumentSection.getEND (  ) 

Get the End of this Document Section.

Returns:
the End Section

Definition at line 143 of file DocumentSection.java.

Here is the call graph for this function:

Here is the caller graph for this function:

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]);.

Parameters:
in String to be processed
Returns:
result of replacement

Definition at line 158 of file DocumentSection.java.

Here is the caller graph for this function:


Member Data Documentation

final String dochelper.DocumentSection.start [private]

Document Sections: Start.

Definition at line 28 of file DocumentSection.java.

final String dochelper.DocumentSection.end [private]

Document Sections: Start.

Definition at line 31 of file DocumentSection.java.

final int dochelper.DocumentSection.START_LEN = 9 [static, private]

Length of ||START||.

Definition at line 34 of file DocumentSection.java.

final int dochelper.DocumentSection.END_LEN = 7 [static, private]

Length of ||END||.

Definition at line 37 of file DocumentSection.java.

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.


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 14:22:02 2009 for DocHelper by  doxygen 1.5.6