|
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 CompilerOption<C extends Compiler>
The interface implemented by all compiler options. We do not implement TerpAware because the option itself cannot decide whether it is enabled, it requires the cooperation of the compiler 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 compiler context that could change,
for example due to a <foreach> iteration over several compilers.
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,
C compiler,
CompilerPhase phase)
Adds the compiler switches repreesnted by this option to the list of switches. |
boolean |
appliesTo(C compiler,
CompilerPhase phase)
Returns true if this compiler option applies to the given compiler and compiler 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(C compiler,
CompilerPhase phase)
compiler - the compiler for which we're asking.phase - the compiler phase we're executing.
void addCommands(java.util.List<java.lang.String> commandList,
C compiler,
CompilerPhase phase)
This method is called by the compiler repeatedly with different values for the compiler phase to account for these possibilities.
commandList - the list to which the compiler switches represented
by this option (if any) are added.compiler - the compiler for which we're doing this.phase - the compiler 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 | |||||||||