dochelper
Class FileTransformDefinition
java.lang.Object
dochelper.FileTransformDefinition
- All Implemented Interfaces:
- TransformDefinition
public class FileTransformDefinition
- extends java.lang.Object
- implements TransformDefinition
The class FileRenderDefinition
implements the
RenderDefinition
interface and is used as the simplest manner in
which to render DocPattern matches.
Field Summary |
private java.lang.String |
TEXT
|
Method Summary |
java.lang.String |
getText()
Retrieves the String template that will be used to render the matches. |
java.lang.String |
render(java.util.regex.MatchResult result)
Main method of RenderDefinition class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEXT
private final java.lang.String TEXT
FileTransformDefinition
public FileTransformDefinition(java.io.File file)
throws InitializationException
- Creates a new instance of FileRenderDefinition
- Parameters:
file
-
- Throws:
InitializationException
FileTransformDefinition
public FileTransformDefinition(java.lang.String path)
throws InitializationException
- Parameters:
path
-
- Throws:
InitializationException
render
public java.lang.String render(java.util.regex.MatchResult result)
- Main method of RenderDefinition class. This method is called to create
the output content given a set of matches for a particular regular
expression.
Once a
DocPattern
is executed, if it finds a set of matches
(within the contents of the record) it will call the
RenderDefinition
associated with it, to render the matches.
- Specified by:
render
in interface TransformDefinition
- Parameters:
result
- java.util.regex.MatchResult that contains the match results for a
regular expression. It contains the whole match and separate groups.
- Returns:
- String containing the render result.
getText
public java.lang.String getText()
- Retrieves the String template that will be used to render the matches.
- Specified by:
getText
in interface TransformDefinition
- Returns:
- String containing template to be used to render matches.