terp - the ANT Tasks
v1.3.337

com.codemesh.terp.ant
Class TerpEcho

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.Echo
              extended by com.codemesh.terp.ant.TerpEcho
All Implemented Interfaces:
TerpAware, TerpContextHolder, java.lang.Cloneable
Direct Known Subclasses:
GenerateVsProject, ResourceOption

public class TerpEcho
extends org.apache.tools.ant.taskdefs.Echo
implements TerpAware

A replacement (or enhancement) echo task that is terp aware. The terp echo task supports an additional attribute called 'template', which allows you to specify the template that is to be expanded by the terp engine. Once the template has been expanded, the regular ANT echo task takes over and all other <echo> attributes are taken into account.

Please be aware that using both the template attribute and nested text will append the expanded template to the nested text.

The terp echo task is used as a nested element in the dynamic source file creation of C++ compiler tasks.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Echo
org.apache.tools.ant.taskdefs.Echo.EchoLevel
 
Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware
TerpAware.Delegate
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.Echo
append, file, logLevel, message
 
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
TerpEcho()
           
TerpEcho(org.apache.tools.ant.Project p)
           
 
Method Summary
 void execute()
           
 TerpContext getContext()
          Returns the context maintained by this instance.
 java.io.File getFile()
           
 java.lang.String getIf()
          Returns the condition that must be satidifed to execute the implementing task.
 java.lang.String getTemplate()
          Returns the template.
 java.lang.String getUnless()
          Returns the condition that must not be satidifed to execute the implementing task.
 boolean satisfiesConditions()
          Returns true if both conditions are met.
 void setContext(TerpContext ctx)
          Sets the context maintained by this instance.
 void setIf(java.lang.String condition)
          Sets a condition that must be satisfied to execute the implementing task.
 void setProject(org.apache.tools.ant.Project p)
           
 void setTemplate(java.lang.String template)
          Sets the template that will be expanded into a resource file.
 void setUnless(java.lang.String condition)
          Sets a condition that must not be satisfied to execute the implementing task.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Echo
addText, setAppend, setEncoding, setFile, setLevel, setMessage, setOutput
 
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

TerpEcho

public TerpEcho()

TerpEcho

public TerpEcho(org.apache.tools.ant.Project p)
Method Detail

setProject

public void setProject(org.apache.tools.ant.Project p)
Overrides:
setProject in class org.apache.tools.ant.ProjectComponent

getContext

public TerpContext getContext()
Description copied from interface: TerpContextHolder
Returns the context maintained by this instance.

Specified by:
getContext in interface TerpContextHolder
Returns:
an execution context.

setContext

public void setContext(TerpContext ctx)
Description copied from interface: TerpContextHolder
Sets the context maintained by this instance.

Specified by:
setContext in interface TerpContextHolder
Parameters:
ctx - the execution context.

execute

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

getFile

public java.io.File getFile()

setTemplate

public void setTemplate(java.lang.String template)
Sets the template that will be expanded into a resource file.

Parameters:
template - the template.

getTemplate

public java.lang.String getTemplate()
Returns the template.

Returns:

getIf

public java.lang.String getIf()
Description copied from interface: TerpAware
Returns the condition that must be satidifed to execute the implementing task.

Specified by:
getIf in interface TerpAware
Returns:
the boolean expression.

getUnless

public java.lang.String getUnless()
Description copied from interface: TerpAware
Returns the condition that must not be satidifed to execute the implementing task.

Specified by:
getUnless in interface TerpAware
Returns:
the boolean expression.

satisfiesConditions

public boolean satisfiesConditions()
Description copied from interface: TerpAware
Returns true if both conditions are met.

Specified by:
satisfiesConditions in interface TerpAware
Returns:
true or false.

setIf

public void setIf(java.lang.String condition)
Description copied from interface: TerpAware
Sets a condition that must be satisfied to execute the implementing task.

Specified by:
setIf in interface TerpAware
Parameters:
condition - a terp expression that must evaluate to a boolean value.

setUnless

public void setUnless(java.lang.String condition)
Description copied from interface: TerpAware
Sets a condition that must not be satisfied to execute the implementing task.

Specified by:
setUnless in interface TerpAware
Parameters:
condition - a terp expression that must evaluate to a boolean value.

terp - the ANT Tasks
v1.3.337

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