FileRecord
implements Record
to represent a single file in a set of files to be processed by DocHelper.
More...
Public Member Functions | |
FileRecord (File file, String name) | |
Creates a New Instance of a File Record. | |
String | getValue () |
Get the value of a File Record. | |
ResultNode | execute (ArrayList< DocPattern > patterns) |
Renders a record using the specified Pattern list. | |
File | getFile () |
Return the file reference. | |
String | toString () |
Protected Attributes | |
HashMap< String, String > | params |
The parameters associated to this fileRecord. | |
Private Attributes | |
File | file |
The file this File Record represents. | |
String | name |
Reference Name for this instance. |
FileRecord
implements Record
to represent a single file in a set of files to be processed by DocHelper.
It is responsible for returning file contents when needed and converting the file into output document content through the execution of the render function.
This class implements the DocumentSection interface in order to provide encapsulation of the output generated.
Record
, DocumentSection
Definition at line 31 of file FileRecord.java.
dochelper.FileRecord.FileRecord | ( | File | file, | |
String | name | |||
) |
Creates a New Instance of a File Record.
Set paramters relevant for this Record
file | ||
name |
Definition at line 49 of file FileRecord.java.
String dochelper.FileRecord.getValue | ( | ) |
Get the value of a File Record.
For this implementation this is the actual contents of the file.
TODO: Change so that once the file is read it is not reloaded unless content has changed.
Implements dochelper.Record.
Definition at line 74 of file FileRecord.java.
ResultNode dochelper.FileRecord.execute | ( | ArrayList< DocPattern > | patterns | ) |
Renders a record using the specified Pattern list.
This method will iterate through all patterns passed in if any, and execute the pattern passing the contents of the file. This means the pattern will search for the RegExp within the file contents.
Implements dochelper.Record.
Definition at line 100 of file FileRecord.java.
File dochelper.FileRecord.getFile | ( | ) |
Return the file reference.
Definition at line 121 of file FileRecord.java.
String dochelper.FileRecord.toString | ( | ) |
Definition at line 125 of file FileRecord.java.
File dochelper.FileRecord.file [private] |
HashMap<String, String> dochelper.FileRecord.params [protected] |
String dochelper.FileRecord.name [private] |
Reference Name for this instance.
Used to fetch info when rendering or processing.
Definition at line 40 of file FileRecord.java.