EscapedMatchNodeDefinition
implements Render Definition
to handle the rendering of matches that include characters that should be escaped when creating a DOM node.
More...
Public Member Functions | |
EscapedMatchTransformDefinition (String text) | |
Creates a new instance of EscapedMatchNodeDefinition. | |
String | render (MatchResult result) |
This method recieves a result and applies its render definition. | |
String | escapeText (String text) |
This Method escapes text passed in, generating a W3 DOM compliant result. | |
String | getText () |
This method gets the text template that this RenderDefinition should use in its render method. | |
Private Attributes | |
final String | TEXT |
EscapedMatchNodeDefinition
implements Render Definition
to handle the rendering of matches that include characters that should be escaped when creating a DOM node.
Definition at line 21 of file EscapedMatchTransformDefinition.java.
dochelper.EscapedMatchTransformDefinition.EscapedMatchTransformDefinition | ( | String | text | ) |
Creates a new instance of EscapedMatchNodeDefinition.
text |
Definition at line 28 of file EscapedMatchTransformDefinition.java.
String dochelper.EscapedMatchTransformDefinition.render | ( | MatchResult | result | ) |
This method recieves a result and applies its render definition.
It performs a basic reg exp search and replace that uses the grouping attributes and behaviour found in the java.util.regex. MatchResultMatchResult
result.
For each group found in the result param the method will search its TEXT variable for a substring composed of "\\$<groupNumber>" and replace it with the match result. Prior to performing the replace, the pertinent group text will be escaped by a call to escapeText
.
result | MatchResult that contains the matches that should be rendered by this class. |
Implements dochelper.TransformDefinition.
Definition at line 51 of file EscapedMatchTransformDefinition.java.
String dochelper.EscapedMatchTransformDefinition.escapeText | ( | String | text | ) |
This Method escapes text passed in, generating a W3 DOM compliant result.
text | String to escape |
Definition at line 80 of file EscapedMatchTransformDefinition.java.
String dochelper.EscapedMatchTransformDefinition.getText | ( | ) |
This method gets the text template that this RenderDefinition should use in its render method.
Implements dochelper.TransformDefinition.
Definition at line 92 of file EscapedMatchTransformDefinition.java.
final String dochelper.EscapedMatchTransformDefinition.TEXT [private] |
Definition at line 23 of file EscapedMatchTransformDefinition.java.