terp - the ANT Tasks
v1.3.304

com.codemesh.terp.ant.devpartner
Class DevPartnerTool

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.codemesh.terp.ant.devpartner.DevPartnerTool
All Implemented Interfaces:
Tool<DevPartnerTool>, TerpAware, TerpContextHolder, java.lang.Cloneable
Direct Known Subclasses:
BoundsChecker

public abstract class DevPartnerTool
extends org.apache.tools.ant.Task
implements Tool<DevPartnerTool>

The base class for all DevPartner tools.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware
TerpAware.Delegate
 
Field Summary
protected  TerpAware.Delegate aware
           
protected  TerpContext ctx
           
protected static TerpEvaluator EVAL
           
protected  java.lang.String failOnError
           
protected  ToolOptionSet<DevPartnerTool> options
           
static ToFile TO_FILE
           
static ToInteger TO_INT
           
protected  ProcessExecutor tool
           
protected  java.lang.String toolSpec
           
 
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
DevPartnerTool()
           
 
Method Summary
 void addOption(ToolOption<DevPartnerTool> option)
          Add a tool option to the tool invocation.
 TerpContext getContext()
          Returns the terp context in which the tool is executing.
 java.lang.String getIf()
          Returns the condition that must be satidifed to execute the implementing task.
 ToolOptionSet<DevPartnerTool> getOptions()
          Returns an object that keeps track of all configured tool options.
 ProcessExecutor getTool()
          Returns the configured executor.
 java.lang.String getUnless()
          Returns the condition that must not be satidifed to execute the implementing task.
 boolean isFailOnError()
          Returns true if the build should be failed if the tool returns an error.
 boolean satisfiesConditions()
          Returns true if both conditions are met.
 void setContext(TerpContext ctx)
          Sets the context maintained by this instance.
 void setFailOnError(java.lang.String failOnError)
          Specifies whether to fail the build if the tool returns an error.
 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 setTool(java.lang.String tool)
          
 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.Task
bindToOwner, execute, 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
 
Methods inherited from interface com.codemesh.terp.ant.devpartner.Tool
getCode, getVersion
 

Field Detail

TO_INT

public static final ToInteger TO_INT

TO_FILE

public static final ToFile TO_FILE

EVAL

protected static final TerpEvaluator EVAL

failOnError

protected java.lang.String failOnError

aware

protected TerpAware.Delegate aware

ctx

protected TerpContext ctx

tool

protected ProcessExecutor tool

toolSpec

protected java.lang.String toolSpec

options

protected ToolOptionSet<DevPartnerTool> options
Constructor Detail

DevPartnerTool

public DevPartnerTool()
Method Detail

setFailOnError

public void setFailOnError(java.lang.String failOnError)
Specifies whether to fail the build if the tool returns an error. The default value is "true".

Parameters:
failOnError - a string that evaluates to a boolean value.

isFailOnError

public boolean isFailOnError()
Returns true if the build should be failed if the tool returns an error. The default value is "true".

Returns:
true if uild should be failed if the tool returns an error.

addOption

public void addOption(ToolOption<DevPartnerTool> option)
Description copied from interface: Tool
Add a tool option to the tool invocation.

Specified by:
addOption in interface Tool<DevPartnerTool>
Parameters:
option - the option to add.

getOptions

public ToolOptionSet<DevPartnerTool> getOptions()
Returns an object that keeps track of all configured tool options.

Specified by:
getOptions in interface Tool<DevPartnerTool>
Returns:
an object that tracks all options.

getIf

public java.lang.String getIf()
Returns the condition that must be satidifed to execute the implementing task.

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

setIf

public void setIf(java.lang.String condition)
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.

getUnless

public java.lang.String getUnless()
Returns the condition that must not be satidifed to execute the implementing task.

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

setUnless

public void setUnless(java.lang.String condition)
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.

satisfiesConditions

public boolean satisfiesConditions()
Returns true if both conditions are met.

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

setProject

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

setContext

public void setContext(TerpContext ctx)
Sets the context maintained by this instance.

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

getContext

public TerpContext getContext()
Returns the terp context in which the tool is executing.

Specified by:
getContext in interface Tool<DevPartnerTool>
Specified by:
getContext in interface TerpContextHolder
Returns:
the terp context.

setTool

public void setTool(java.lang.String tool)


getTool

public ProcessExecutor getTool()
Returns the configured executor.


terp - the ANT Tasks
v1.3.304

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