com.pushtotest.tool.response
Class RESearchLink

java.lang.Object
  extended by com.pushtotest.tool.response.RESearchLink
All Implemented Interfaces:
ResponseLink

public class RESearchLink
extends java.lang.Object
implements ResponseLink

ResponseLink implementation that searches using regular expressions


Constructor Summary
RESearchLink()
           
 
Method Summary
 void finalize()
          This method will be called after the handle() method returns.
 Response handle(Response response)
          The returned response object will contain two new parameters: research.foundcount - the number of matches research.founditems - A java.util.List containing all the "match sets" Each "match set" is an Array of the "groups" where group 0 is the entire match.
 void init(ResponseLinkConfig config)
          Init processes the ResponseLinConfig parameters config must contain: "pattern" - Regular Expression Pattern, string config can optionally contain: "CASE_INSENSITIVE" "MULTILINE" "DOTALL" "UNICODE_CASE" "CANON_EQ" The existance of each within the config object, sets the matching java.util.regex.Pattern flag on the expression compile See the Sun documentation for the specific regular expression syntax used at: http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RESearchLink

public RESearchLink()
Method Detail

init

public void init(ResponseLinkConfig config)
          throws ToolException
Init processes the ResponseLinConfig parameters config must contain: "pattern" - Regular Expression Pattern, string config can optionally contain: "CASE_INSENSITIVE" "MULTILINE" "DOTALL" "UNICODE_CASE" "CANON_EQ" The existance of each within the config object, sets the matching java.util.regex.Pattern flag on the expression compile See the Sun documentation for the specific regular expression syntax used at: http://java.sun.com/j2se/1.4/docs/api/java/util/regex/Pattern.html

Specified by:
init in interface ResponseLink
Parameters:
config - The ResponseLinkConfig to initialize this link.
Throws:
ToolException - "pattern" parameter is missing

handle

public Response handle(Response response)
                throws ToolException
The returned response object will contain two new parameters: research.foundcount - the number of matches research.founditems - A java.util.List containing all the "match sets" Each "match set" is an Array of the "groups" where group 0 is the entire match.

Specified by:
handle in interface ResponseLink
Parameters:
response - The Response object to handle.
Returns:
The Response object including any extra parameters, etc.
Throws:
ToolException - Pattern has not been initialized
UnsupportedTypeException - If the id() method call on the Response object returns a type that this ResponseLink cannot handle.

finalize

public void finalize()
This method will be called after the handle() method returns. It will allow you to clean up after yourself in any way that is needed.

Specified by:
finalize in interface ResponseLink
Overrides:
finalize in class java.lang.Object