org.apache.anteater.test
Class MatcherSet

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.anteater.test.BaseTask
                    |
                    +--org.apache.anteater.test.MatcherSet
All Implemented Interfaces:
Groupable, ObjectModel

public class MatcherSet
extends BaseTask
implements ObjectModel

MatcherSet maintains a set of Matchers to be applied on an object.

When the MatcherSet is executed, the Matcher elements are applied in order on the matched object. The matching stops when the first set of tests specified by a Matcher succeed. In this case the result of the MatcherSet is true. If no Matcher object matches, the result of the MatcherSet is false.

MatcherSet's "lifecycle" consists of having the following methods called:

The ActionTask.execute() method is typically responsible for taking a MatcherSet through it's lifecycle.

Since:
October 29, 2001
Version:
$Revision: 1.12 $ $Date: 2002/10/26 11:49:50 $
Author:
Ovidiu Predescu
See Also:
Owner of a MatcherSet., Child element of a MatcherSet

Field Summary
protected  Logger logger
           
protected  ArrayList matchers
          The list of Matcher instances.
protected  Object matchOn
          The object to match on.
protected  Map objectModel
          The object model obtained from this object's container (usually a Listener or an HttpRequest).
protected  boolean result
          Whether all MatcherTests in this MatcherSet have passed or not.
 
Fields inherited from class org.apache.anteater.test.BaseTask
debug, debugWasSet
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Fields inherited from interface org.apache.anteater.test.ObjectModel
NAMESPACES_KEY, PROPERTIES_KEY
 
Constructor Summary
MatcherSet()
          Creates a new MatcherSet instance.
 
Method Summary
 void addMatcher(Matcher matcher)
           
 void execute()
           
 boolean getResult()
           
 void setLogger(Logger logger)
           
 void setMatchOn(Object matchOn)
           
 void setObjectModel(Map objectModel)
          Set the context in the receiving object.
 
Methods inherited from class org.apache.anteater.test.BaseTask
debug, getDebug, getGroup, print, println, resolveContentURL, setDebug, setGroup, setGroup
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected boolean result
Whether all MatcherTests in this MatcherSet have passed or not.


matchers

protected ArrayList matchers
The list of Matcher instances.


matchOn

protected Object matchOn
The object to match on.


objectModel

protected Map objectModel
The object model obtained from this object's container (usually a Listener or an HttpRequest).


logger

protected Logger logger
Constructor Detail

MatcherSet

public MatcherSet()
Creates a new MatcherSet instance.

Method Detail

addMatcher

public void addMatcher(Matcher matcher)

setMatchOn

public void setMatchOn(Object matchOn)

getResult

public boolean getResult()

setObjectModel

public void setObjectModel(Map objectModel)
Description copied from interface: ObjectModel
Set the context in the receiving object.

Specified by:
setObjectModel in interface ObjectModel
Parameters:
objectModel - a HashMap value

setLogger

public void setLogger(Logger logger)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException


Ant Functional Tester -- see Project home page for details