net.sf.antcontrib.cpptasks.types
Class ConditionalPath

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.types.DataType
              |
              +--org.apache.tools.ant.types.Path
                    |
                    +--net.sf.antcontrib.cpptasks.types.ConditionalPath
Direct Known Subclasses:
IncludePath, SystemIncludePath

public class ConditionalPath
extends org.apache.tools.ant.types.Path

An Ant Path object augmented with if and unless conditionals

Author:
Curt Arnold

Inner classes inherited from class org.apache.tools.ant.types.Path
org.apache.tools.ant.types.Path.PathElement
 
Fields inherited from class org.apache.tools.ant.types.Path
systemClasspath
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, description, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
ConditionalPath(org.apache.tools.ant.Project project)
           
ConditionalPath(org.apache.tools.ant.Project p, java.lang.String path)
           
 
Method Summary
 boolean isActive(org.apache.tools.ant.Project p)
          Returns true if the Path's if and unless conditions (if any) are satisfied.
 void setIf(java.lang.String propName)
          Sets the property name for the 'if' condition.
 void setUnless(java.lang.String propName)
          Set the property name for the 'unless' condition.
 
Methods inherited from class org.apache.tools.ant.types.Path
addDirset, addExisting, addExtdirs, addFilelist, addFileset, addJavaRuntime, append, clone, concatSystemClasspath, concatSystemClasspath, createPath, createPathElement, dieOnCircularReference, list, setLocation, setPath, setRefid, size, toString, translateFile, translateFileSep, translatePath
 
Methods inherited from class org.apache.tools.ant.types.DataType
circularReference, getCheckedRef, getDescription, isReference, noChildrenAllowed, setDescription, tooManyAttributes
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalPath

public ConditionalPath(org.apache.tools.ant.Project p,
                       java.lang.String path)

ConditionalPath

public ConditionalPath(org.apache.tools.ant.Project project)
Method Detail

setIf

public void setIf(java.lang.String propName)
Sets the property name for the 'if' condition. The path 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

setUnless

public void setUnless(java.lang.String propName)
Set the property name for the 'unless' condition. If named property is set, the path 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

isActive

public boolean isActive(org.apache.tools.ant.Project p)
                 throws org.apache.tools.ant.BuildException
Returns true if the Path's if and unless conditions (if any) are satisfied.


Copyright © 2001-2002 Ant-Contrib project. All Rights Reserved.