FileRecordSet
implements the RecordSet
interface to create a set of Records
to be processed.
More...
Public Member Functions | |
void | setParam (String paramName, Object value) throws IllegalParamterTypeException |
Add an initialization parameter to the Record Set. | |
void | checkParams () throws InvalidValueException, MissingArgumentException, ResourceUnavailableException |
Checks that the parameters are correct for this File Record Set. | |
void | init () throws InitializationException, ResourceUnavailableException |
Initialize the Record Set. | |
ResultNode | execute (ResultNode doc) throws ResourceUnavailableException |
Main method of FileRecordSet. | |
ArrayList< Record > | getRsfiles () |
Record Files (rsfiles) Accessors + Modifiers. | |
void | setRsfiles (ArrayList< Record > rsfiles) |
ArrayList< DocPattern > | getPatterns () |
Pattern Accessors + Modifiers. | |
void | setPatterns (ArrayList< DocPattern > patterns) |
String | getName () |
Name Accessors + Modifiers. | |
void | setName (String name) |
Set the name of this Record Set. | |
void | addPattern (DocPattern pattern) |
Add a single pattern to be applied to this record set. | |
void | clearPatterns () |
Empty pattern list. | |
String | toString () |
Protected Member Functions | |
void | _listDirectory (ArrayList stack, ArrayList files, String directory, String glob, boolean recursive) throws IOException |
Protected Attributes | |
HashMap< String, Object > | params = new HashMap<String, Object>() |
Paramters for this configurable. | |
ArrayList< Record > | rsfiles |
The files that are represented by this Path and Filter. | |
Static Protected Attributes | |
static final String | PATH = "path" |
Param keys, path, glob and recursive. | |
static final String | RECUR = "recursive" |
Param key: recursive. | |
static final String | GLOB = "glob" |
Param key: glob. | |
Private Attributes | |
String | name |
Reference Name for this instance. | |
ArrayList< DocPattern > | patterns |
FileRecordSet
implements the RecordSet
interface to create a set of Records
to be processed.
This class is used to drive the DocHelper process by invoking the render function on each Record
within the RecordSet
passing in the DocPattern
defined for this records set.
Record
, DocumentSection
Definition at line 35 of file FileRecordSet.java.
void dochelper.FileRecordSet.setParam | ( | String | paramName, | |
Object | value | |||
) | throws IllegalParamterTypeException |
Add an initialization parameter to the Record Set.
These parameters are used during the call to init to Establish - Initialize the RecordSet. Eg. These paramters set the path, glob, recursive. It is the responsibility of this method to check correct types for params used. For the FileRecordSet only string parameters are used
paramName | String Name of the paramter to be stored | |
value | String value of the named param |
IllegalParamterTypeException |
Implements dochelper.Configurable.
Definition at line 83 of file FileRecordSet.java.
void dochelper.FileRecordSet.checkParams | ( | ) | throws InvalidValueException, MissingArgumentException, ResourceUnavailableException |
Checks that the parameters are correct for this File Record Set.
Validate required parameters and semantic and format rules.
This method will not return a boolean indicating success, rather, it will fire an Exception indicating error type
InvalidValueException | ||
MissingArgumentException | ||
ResourceUnavailableException |
Implements dochelper.Configurable.
Definition at line 102 of file FileRecordSet.java.
void dochelper.FileRecordSet.init | ( | ) | throws InitializationException, ResourceUnavailableException |
Initialize the Record Set.
This method builds the list of files represented by the parameter set. Given the path, glob and recursive params a list is built recursivley.
ResourceUnavailableException |
Implements dochelper.Configurable.
Definition at line 126 of file FileRecordSet.java.
ResultNode dochelper.FileRecordSet.execute | ( | ResultNode | doc | ) | throws ResourceUnavailableException |
Main method of FileRecordSet.
This appends to the document tree the output generated by interpreting this FileRecordSet.
The results are obtained by matching each pattern (n number of times ) within the value returned by Record getValue(). This call returns the contects of the file itself.
doc | The document ResultNode onto which the results of running this record set should be added to. |
ResultNode
node with the results of the matches and rendering appended to it.ResourceUnavailableException | ||
Exception |
Implements dochelper.RecordSet.
Definition at line 168 of file FileRecordSet.java.
void dochelper.FileRecordSet._listDirectory | ( | ArrayList | stack, | |
ArrayList | files, | |||
String | directory, | |||
String | glob, | |||
boolean | recursive | |||
) | throws IOException [protected] |
stack | ||
files | ||
directory | ||
glob | ||
recursive |
java.io.IOException |
Reimplemented in dochelper.xins.XINSFunctionRecordSet.
Definition at line 195 of file FileRecordSet.java.
ArrayList<Record> dochelper.FileRecordSet.getRsfiles | ( | ) |
Record Files (rsfiles) Accessors + Modifiers.
Definition at line 239 of file FileRecordSet.java.
void dochelper.FileRecordSet.setRsfiles | ( | ArrayList< Record > | rsfiles | ) |
rsfiles |
Definition at line 247 of file FileRecordSet.java.
ArrayList<DocPattern> dochelper.FileRecordSet.getPatterns | ( | ) |
void dochelper.FileRecordSet.setPatterns | ( | ArrayList< DocPattern > | patterns | ) |
String dochelper.FileRecordSet.getName | ( | ) |
Name Accessors + Modifiers.
Definition at line 273 of file FileRecordSet.java.
void dochelper.FileRecordSet.setName | ( | String | name | ) |
Set the name of this Record Set.
The name of the Record Set is used in conjunction with items that use the name to fetch the appropriate part of the result tree. This includes renderers.
name |
Implements dochelper.RecordSet.
Definition at line 277 of file FileRecordSet.java.
void dochelper.FileRecordSet.addPattern | ( | DocPattern | pattern | ) |
Add a single pattern to be applied to this record set.
pattern | DocPettern to add to this Record Set. |
Implements dochelper.RecordSet.
Definition at line 287 of file FileRecordSet.java.
void dochelper.FileRecordSet.clearPatterns | ( | ) |
Empty pattern list.
Implements dochelper.RecordSet.
Definition at line 299 of file FileRecordSet.java.
String dochelper.FileRecordSet.toString | ( | ) |
final String dochelper.FileRecordSet.PATH = "path" [static, protected] |
final String dochelper.FileRecordSet.RECUR = "recursive" [static, protected] |
final String dochelper.FileRecordSet.GLOB = "glob" [static, protected] |
String dochelper.FileRecordSet.name [private] |
Reference Name for this instance.
Used to fetch info when rendering or processing.
Definition at line 55 of file FileRecordSet.java.
HashMap<String, Object> dochelper.FileRecordSet.params = new HashMap<String, Object>() [protected] |
ArrayList<Record> dochelper.FileRecordSet.rsfiles [protected] |
The files that are represented by this Path and Filter.
This is equivalent to the records in this record set
Definition at line 65 of file FileRecordSet.java.
ArrayList<DocPattern> dochelper.FileRecordSet.patterns [private] |
Definition at line 68 of file FileRecordSet.java.