Package net.sf.antcontrib.cpptasks.types
Class UndefineArgument
- java.lang.Object
-
- net.sf.antcontrib.cpptasks.types.UndefineArgument
-
- Direct Known Subclasses:
DefineArgument
public class UndefineArgument extends java.lang.Object
Preprocessor macro undefinition.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
define
private java.lang.String
ifCond
private java.lang.String
name
private java.lang.String
unlessCond
-
Constructor Summary
Constructors Modifier Constructor Description UndefineArgument()
protected
UndefineArgument(boolean isDefine)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
java.lang.String
getName()
Returns the name of the definejava.lang.String
getValue()
Returns the value of the defineboolean
isActive(org.apache.tools.ant.Project p)
Returns true if the define's if and unless conditions (if any) are satisfied.boolean
isDefine()
Returns true if this is a define, false if an undefine.static UndefineArgument[]
merge(UndefineArgument[] base, UndefineArgument[] override)
This method returns an array of UndefineArgument and DefineArgument's by merging a base list with an override list.void
setIf(java.lang.String propName)
Sets the property name for the 'if' condition.void
setName(java.lang.String name)
Set the name attributevoid
setUnless(java.lang.String propName)
Set the property name for the 'unless' condition.
-
-
-
Method Detail
-
merge
public static UndefineArgument[] merge(UndefineArgument[] base, UndefineArgument[] override)
This method returns an array of UndefineArgument and DefineArgument's by merging a base list with an override list. Any define in the base list with a name that appears in the override list is suppressed. All entries in the override list are preserved
-
execute
public void execute() throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
-
getName
public final java.lang.String getName()
Returns the name of the define
-
getValue
public java.lang.String getValue()
Returns the value of the define
-
isActive
public final boolean isActive(org.apache.tools.ant.Project p) throws org.apache.tools.ant.BuildException
Returns true if the define's if and unless conditions (if any) are satisfied.- Throws:
org.apache.tools.ant.BuildException
- throws build exception if name is not set
-
isDefine
public final boolean isDefine()
Returns true if this is a define, false if an undefine.
-
setIf
public final void setIf(java.lang.String propName)
Sets the property name for the 'if' condition. The define will be ignored unless the property is defined. The value of the property is insignificant, but values that would imply misinterpretation ("false", "no") will throw an exception when evaluated.- Parameters:
propName
- property name
-
setName
public final void setName(java.lang.String name)
Set the name attribute
-
setUnless
public final void setUnless(java.lang.String propName)
Set the property name for the 'unless' condition. If named property is set, the define will be ignored. The value of the property is insignificant, but values that would imply misinterpretation ("false", "no") of the behavior will throw an exception when evaluated.- Parameters:
propName
- name of property
-
-