|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.anteater.test.BaseTask | +--org.apache.anteater.test.ContentHandlerTask | +--org.apache.anteater.test.MatcherTest
Matches an object against another. This class is the parent of all Matcher Tests, which make up the majority of Anteater tasks. This class contains some fields common to all matcher tests ('assign' property, body content, owner Matcher, object model).
A MatcherTest
's lifecycle consists of the methods:
Matcher
element. This corresponds to how <match> elements contain nested
tests.
Field Summary | |
protected Logger |
logger
|
protected Matcher |
matcher
The container of this matcher. |
protected Map |
objectModel
The object model inherited from our container, usually a Matcher . |
protected String |
property
The Ant property name under which the value of the matching object should be stored. |
Fields inherited from class org.apache.anteater.test.ContentHandlerTask |
handlerFactory, matcherTests |
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 | |
MatcherTest()
|
Method Summary | |
void |
addText(String text)
Sets the body text. |
Object |
getMatchOn()
|
boolean |
getResult()
|
protected String |
getText()
Retrieves the body text. |
void |
setAssign(String name)
|
void |
setLogger(Logger logger)
|
void |
setMatcher(Matcher parent)
|
void |
setObjectModel(Map objectModel)
Set the context in the receiving object. |
protected void |
setPropertyValue(String value)
Called by subclasses to set the 'assign' property to a value from the matched object. |
abstract boolean |
validate()
Return true if this instance matches against the matchOn object of the matcher . |
Methods inherited from class org.apache.anteater.test.ContentHandlerTask |
addTask, execute |
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 |
protected Matcher matcher
protected String property
protected Map objectModel
Matcher
.
protected Logger logger
Constructor Detail |
public MatcherTest()
Method Detail |
public void addText(String text) throws org.apache.tools.ant.BuildException
addText
in class ContentHandlerTask
org.apache.tools.ant.BuildException
protected String getText()
public void setObjectModel(Map objectModel)
ObjectModel
setObjectModel
in interface ObjectModel
objectModel
- a HashMap
valuepublic void setLogger(Logger logger)
public void setMatcher(Matcher parent)
public void setAssign(String name)
protected void setPropertyValue(String value)
public Object getMatchOn()
public abstract boolean validate() throws org.apache.tools.ant.BuildException
matchOn
object of the matcher
.
boolean
value
org.apache.tools.ant.BuildException
public boolean getResult()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |