|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ant.ConditionalElement
public class ConditionalElement
The base class for any nested element which can be conditional.
This class supports the attributes [if] and [unless]. When the if-attribute is specified, the corresponding property needs to be defined in ant's build.xml. When the unless-attribute is defined, the corresponding property must not be defined in the build.xml. Classes can check if the conditions of this element are met by calling isActive(). Nested elements which want to make use of other conditional nested element needs to have a reference to the ant-project. This can be done with the help of the create<nested-element-name> method.
The if- and unless-conditions can now also refer to complex terms and use J2ME Polish variables and symbols. This has to be supported specifically by the implementation, though - the implementation needs to call isActive( BooleanEvaluator ).
Copyright Enough Software 2004 - 2011
history
25-Feb-2004 - rob creation
| Constructor Summary | |
|---|---|
ConditionalElement()
Creates a new conditional element. |
|
ConditionalElement(ConditionalElement parent)
|
|
| Method Summary | |
|---|---|
String |
getCondition()
|
String |
getIf()
|
String |
getUnless()
|
boolean |
isActive(BooleanEvaluator evaluator)
Checks if the conditions for this element are met. |
boolean |
isActive(BooleanEvaluator evaluator,
org.apache.tools.ant.Project project)
Checks if the conditions for this element are met. |
boolean |
isActive(Environment environment)
Checks if the conditions for this element are met. |
boolean |
isActive(org.apache.tools.ant.Project project)
Checks if this element should be used. |
void |
setIf(String ifExpr)
Sets the ant-property which needs to be defined to allow the execution of this task. |
void |
setUnless(String unlessExpr)
Sets the ant-property which must not be defined to allow the execution of this task. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConditionalElement()
public ConditionalElement(ConditionalElement parent)
| Method Detail |
|---|
public void setIf(String ifExpr)
ifExpr - the ant-property which needs to be definedpublic void setUnless(String unlessExpr)
unlessExpr - the ant-property which must not be definedpublic boolean isActive(org.apache.tools.ant.Project project)
project - The project to which this nested element belongs to.
public boolean isActive(BooleanEvaluator evaluator,
org.apache.tools.ant.Project project)
evaluator - the boolean evaluator with the settings for the current deviceproject - the Ant project into which this variable is embedded
public boolean isActive(Environment environment)
environment - the environment settings
public boolean isActive(BooleanEvaluator evaluator)
evaluator - the boolean evaluator with the settings for the current device
public String getIf()
public String getUnless()
public String getCondition()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||