net.sf.jameleon.bean
Class MatchingTextHelper

java.lang.Object
  extended by net.sf.jameleon.bean.MatchingTextHelper

public class MatchingTextHelper
extends Object

This class is used to be a generic regex text matcher helper to be used in plug-ins wanting the regex (and maybe later the xpath) functionality to match the given expression and set the matching text in the provided context variable.


Field Summary
protected  TextMatcher matcher
           
 
Constructor Summary
MatchingTextHelper(TextMatcher matcher)
          Creates a MatchingTextHelper with a TextMatcher that is used for the following.
 
Method Summary
 void setMatchingTextInContext(String varName, String regex, int regexGroup)
          Sets the matching text in the provided context variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matcher

protected TextMatcher matcher
Constructor Detail

MatchingTextHelper

public MatchingTextHelper(TextMatcher matcher)
Creates a MatchingTextHelper with a TextMatcher that is used for the following.
  1. get the current screen as text.
  2. Get the matching regular expression.
  3. Set the variable in the context.
You should find the last two are methods that are already implemented in the FunctionTag.

Parameters:
matcher - - The interface used to communicate with the plug-in.
Method Detail

setMatchingTextInContext

public void setMatchingTextInContext(String varName,
                                     String regex,
                                     int regexGroup)
Sets the matching text in the provided context variable.

Parameters:
varName - - The context variable name
regex - - The regular with the grouping representing the text to match
regexGroup - - The number of the group to match.


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.