dochelper
Class EscapedMatchTransformDefinition

java.lang.Object
  extended by dochelper.EscapedMatchTransformDefinition
All Implemented Interfaces:
TransformDefinition

public class EscapedMatchTransformDefinition
extends java.lang.Object
implements TransformDefinition

The class EscapedMatchNodeDefinition implements Render Definition to handle the rendering of matches that include characters that should be escaped when creating a DOM node.


Field Summary
private  java.lang.String TEXT
           
 
Constructor Summary
EscapedMatchTransformDefinition(java.lang.String text)
          Creates a new instance of EscapedMatchNodeDefinition
 
Method Summary
 java.lang.String escapeText(java.lang.String text)
          This Method escapes text passed in, generating a W3 DOM compliant result.
 java.lang.String getText()
          This method gets the text template that this RenderDefinition should use in its render method.
 java.lang.String render(java.util.regex.MatchResult result)
          This method recieves a result and applies its render definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT

private final java.lang.String TEXT
Constructor Detail

EscapedMatchTransformDefinition

public EscapedMatchTransformDefinition(java.lang.String text)
Creates a new instance of EscapedMatchNodeDefinition

Parameters:
text -
Method Detail

render

public java.lang.String render(java.util.regex.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 "\\$" and replace it with the match result. Prior to performing the replace, the pertinent group text will be escaped by a call to escapeText.

Specified by:
render in interface TransformDefinition
Parameters:
result - MatchResult that contains the matches that should be rendered by this class.
Returns:
String that contains the resulting output once the matches have been processed by this class.
See Also:
MatchResult

escapeText

public java.lang.String escapeText(java.lang.String text)
This Method escapes text passed in, generating a W3 DOM compliant result.

Parameters:
text - String to escape
Returns:
String Escaped text.

getText

public java.lang.String getText()
This method gets the text template that this RenderDefinition should use in its render method.

Specified by:
getText in interface TransformDefinition
Returns:
String RenderDefinition text template