|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdochelper.DocPattern
public class DocPattern
The class DocPattern
implements one of the principal components
of DocHelper, the Pattern. It is intended to hold a Regular Expression
pattern in String form and RenderDefinition
. The regular
expression indicates what to match in Record
, and the
RenderDefinition
indicates how to render the matches for each
Record
.
This class implements RenderDefinition
to become a rendering
mechanism itself. TODO.
This class implements DocumentSection
in order to implement
output encapsulation.
DocumentSection
, RenderDefinition
Field Summary | |
---|---|
private java.lang.String |
name
|
(package private) TransformDefinition |
node
The Node Definition that tells this pattern how to render matches |
(package private) java.util.HashMap<java.lang.String,java.lang.String> |
params
|
(package private) java.util.regex.Pattern |
regExp
String: Regular Expressions Pattern to Match |
Constructor Summary | |
---|---|
DocPattern(java.lang.String pattern)
Creates a new instance. |
|
DocPattern(java.lang.String pattern,
TransformDefinition transform)
Creates a new instance. |
Method Summary | |
---|---|
ResultNode |
execute(java.lang.String value)
Executes this pattern for the given value. |
java.lang.String |
getName()
Name Accessor + Modifier |
java.lang.String |
getText()
Implementation of the RenderDefinition interface. |
java.lang.String |
render(java.util.regex.MatchResult mr)
Render the matchresult passed in behaving as if this pattern was a RenderDefiniton. |
void |
setName(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
TransformDefinition node
java.util.regex.Pattern regExp
private java.lang.String name
java.util.HashMap<java.lang.String,java.lang.String> params
Constructor Detail |
---|
public DocPattern(java.lang.String pattern) throws java.util.regex.PatternSyntaxException
pattern
- String that defines the regular expression to search for
java.util.regex.PatternSyntaxException
public DocPattern(java.lang.String pattern, TransformDefinition transform) throws java.util.regex.PatternSyntaxException
pattern
- String that defines the regular expression to search fortransform
-
java.util.regex.PatternSyntaxException
Method Detail |
---|
public ResultNode execute(java.lang.String value)
DocPattern
and pass the result to the RenderDefinition associated with it , to render the result.
value
- String that hold the value that will be search for matches of the pattern.
public java.lang.String render(java.util.regex.MatchResult mr)
render
in interface TransformDefinition
mr
-
public java.lang.String getText()
getText
in interface TransformDefinition
public java.lang.String getName()
public void setName(java.lang.String name)
name
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |