dochelper.DocPattern Class Reference

The class DocPattern implements one of the principal components of DocHelper, the Pattern. More...

Inheritance diagram for dochelper.DocPattern:

Inheritance graph
[legend]
Collaboration diagram for dochelper.DocPattern:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DocPattern (String pattern) throws PatternSyntaxException
 Creates a new instance.
 DocPattern (String pattern, TransformDefinition transform) throws PatternSyntaxException
 Creates a new instance.
ResultNode execute (String value)
 Executes this pattern for the given value.
String render (MatchResult mr)
 Render the matchresult passed in behaving as if this pattern was a RenderDefiniton.
String getText ()
 Implementation of the RenderDefinition interface.
String getName ()
 Name Accessor + Modifier.
void setName (String name)

Package Attributes

TransformDefinition node
 The Node Definition that tells this pattern how to render matches.
Pattern regExp
 String: Regular Expressions Pattern to Match.
HashMap< String, String > params

Private Attributes

String name


Detailed Description

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.

See also:
DocumentSection, RenderDefinition
Author:
Guillermo Christen

Definition at line 36 of file DocPattern.java.


Constructor & Destructor Documentation

dochelper.DocPattern.DocPattern ( String  pattern  )  throws PatternSyntaxException

Creates a new instance.

This Object represents a regular expression pattern and how it should be rendered in the resulting document. The rendering is done through the relationship to its NodeDefinition. A pattern implements the NodeDefinition interface itself in order to be itself a valid way to render a node.

Parameters:
pattern String that defines the regular expression to search for
Exceptions:
PatternSyntaxException 

Definition at line 67 of file DocPattern.java.

dochelper.DocPattern.DocPattern ( String  pattern,
TransformDefinition  transform 
) throws PatternSyntaxException

Creates a new instance.

This Object represents a regular expression pattern and how it should be rendered in the resulting document. The rendering is done through the relationship to its RenderDefinition. A pattern implements the RenderDefinition interface itself in order to be itself a valid way to render a pattern.

Parameters:
pattern String that defines the regular expression to search for
transform 
Exceptions:
PatternSyntaxException 

Definition at line 86 of file DocPattern.java.

Here is the call graph for this function:


Member Function Documentation

ResultNode dochelper.DocPattern.execute ( String  value  ) 

Executes this pattern for the given value.

This method will match the regular expression for this DocPattern and pass the result to the RenderDefinition associated with it , to render the result.

Parameters:
value String that hold the value that will be search for matches of the pattern.
Returns:
The resulting document section after searching for matches and rendering them acording to the RenderDefinition and encapsulating the result between START and END if defined.

Definition at line 105 of file DocPattern.java.

Here is the call graph for this function:

String dochelper.DocPattern.render ( MatchResult  mr  ) 

Render the matchresult passed in behaving as if this pattern was a RenderDefiniton.

Implementation of the RenderDefinition.

TODO: X or Implement, Document.

Parameters:
mr 

Implements dochelper.TransformDefinition.

Definition at line 134 of file DocPattern.java.

String dochelper.DocPattern.getText (  ) 

Implementation of the RenderDefinition interface.

Implementing the RenderDefinition interface allows a DocPattern to have a sub pattern perform the rendering functions. The allow nesting to occur.

TODO: X or Implement, Document.

Implements dochelper.TransformDefinition.

Definition at line 146 of file DocPattern.java.

String dochelper.DocPattern.getName (  ) 

Name Accessor + Modifier.

Returns:

Definition at line 153 of file DocPattern.java.

void dochelper.DocPattern.setName ( String  name  ) 

Parameters:
name 

Definition at line 161 of file DocPattern.java.

Here is the caller graph for this function:


Member Data Documentation

The Node Definition that tells this pattern how to render matches.

Definition at line 39 of file DocPattern.java.

Pattern dochelper.DocPattern.regExp [package]

String: Regular Expressions Pattern to Match.

Definition at line 42 of file DocPattern.java.

String dochelper.DocPattern.name [private]

Definition at line 49 of file DocPattern.java.

HashMap<String, String> dochelper.DocPattern.params [package]

Definition at line 52 of file DocPattern.java.


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 14:21:59 2009 for DocHelper by  doxygen 1.5.6