|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ToolOption<T extends Tool>
The interface implemented by all tool options. We do not implement TerpAware because the option itself cannot decide whether it is enabled, it requires the cooperation of the tool to retrieve the project and context.
This interface is very similar to the TerpAware
interface, but just different enough that we could not reuse it. TerpAware
tasks are evaluated in a single, implicit context, the project context. Compiler
options on the other hand are evaluated in a tool context that could change,
for example due to a <foreach> iteration over several tools.
This requires an additional argument for the satisfies(com.codemesh.terp.api.TerpContext)
method.
| Method Summary | |
|---|---|
void |
addCommands(java.util.List<java.lang.String> commandList,
T tool,
ToolPhase phase)
Adds the tool switches repreesnted by this option to the list of switches. |
boolean |
appliesTo(T tool,
ToolPhase phase)
Returns true if this tool option applies to the given tool and tool phase. |
java.lang.String |
getIf()
Returns the condition that must be satidifed to execute the implementing task. |
java.lang.String |
getUnless()
Returns the condition that must not be satidifed to execute the implementing task. |
boolean |
satisfies(TerpContext ctx)
Returns true if both conditions are met within the given terp context. |
void |
setIf(java.lang.String condition)
Sets a condition that must be satisfied to execute the implementing task. |
void |
setUnless(java.lang.String condition)
Sets a condition that must not be satisfied to execute the implementing task. |
| Method Detail |
|---|
boolean appliesTo(T tool,
ToolPhase phase)
tool - the tool for which we're asking.phase - the tool phase we're executing.
void addCommands(java.util.List<java.lang.String> commandList,
T tool,
ToolPhase phase)
This method is called by the tool repeatedly with different values for the tool phase to account for these possibilities.
commandList - the list to which the tool switches represented
by this option (if any) are added.tool - the tool for which we're doing this.phase - the tool phase in wihch we're doing this.void setIf(java.lang.String condition)
condition - a terp expression that must evaluate to a boolean value.java.lang.String getIf()
void setUnless(java.lang.String condition)
condition - a terp expression that must evaluate to a boolean value.java.lang.String getUnless()
boolean satisfies(TerpContext ctx)
ctx - the terp context in which the logical expressions are evaluated.
|
terp - the ANT Tasks v1.3.304 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||