terp - the ANT Tasks
v1.3.337

com.codemesh.terp.ant
Class Fail

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.codemesh.terp.ant.TerpAwareTask
              extended by com.codemesh.terp.ant.Fail
All Implemented Interfaces:
TerpAware, TerpContextHolder, java.lang.Cloneable

public class Fail
extends TerpAwareTask

A fail replacement that simplifies unit-testing of ANT tasks by supporting terp if and unless conditions .


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware
TerpAware.Delegate
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
Fail()
           
Fail(org.apache.tools.ant.Project p)
           
 
Method Summary
 void execute()
           
 void setMessage(java.lang.String message)
          Set the message to display in the case of failure.
 void setMessageExpression(java.lang.String message)
          Set an expression to be evaluated (not expanded) and used as the failure message.
 
Methods inherited from class com.codemesh.terp.ant.TerpAwareTask
getContext, getIf, getUnless, satisfiesConditions, setContext, setIf, setProject, setUnless
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fail

public Fail(org.apache.tools.ant.Project p)

Fail

public Fail()
Method Detail

setMessage

public void setMessage(java.lang.String message)
Set the message to display in the case of failure. The message may be a template string containing variables that are going to be expanded in the current project's context.

Parameters:
message - the failure message.
See Also:
the attribute value is interpreted as a terp expression to be evaluated rather than a template string to be expanded.

setMessageExpression

public void setMessageExpression(java.lang.String message)
Set an expression to be evaluated (not expanded) and used as the failure message. For example, the expression 3*4 would result in the display of the string "12" in the case of failure. This option is very useful for the display of process invocation output based on a result variable.

Parameters:
message - the terp expression.
See Also:
the attribute value is interpreted as a template string to be expanded rather than a terp expression to be evaluated.

execute

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

terp - the ANT Tasks
v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.