de.enough.polish.ant.requirements
Class Requirements

java.lang.Object
  extended by de.enough.polish.ant.requirements.RequirementContainer
      extended by de.enough.polish.ant.requirements.AndRelation
          extended by de.enough.polish.ant.requirements.Requirements
All Implemented Interfaces:
DeviceFilter

public class Requirements
extends AndRelation

A list of requirements which each supported device needs to satisfy.

Copyright Enough Software 2004 - 2011

 history
        24-Jan-2004 - rob creation
 

Author:
Robert Virkus, robert@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.ant.requirements.RequirementContainer
requiredIdentifiers
 
Constructor Summary
Requirements()
          Creates a new device requirements list.
Requirements(Map buildProperties)
          Cerates a new device requirements list.
 
Method Summary
 Device[] filterDevices(Device[] availableDevices)
          Filters the available devices and only returns those which satisfy all requirements.
 boolean isActive(BooleanEvaluator evaluator)
          Checks if this element should be used.
 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 setMessage(String message)
           
 void setUnless(String unlessExpr)
          Sets the ant-property which must not be defined to allow the execution of this task.
 
Methods inherited from class de.enough.polish.ant.requirements.AndRelation
isMet
 
Methods inherited from class de.enough.polish.ant.requirements.RequirementContainer
add, addConfiguredAnd, addConfiguredNand, addConfiguredNot, addConfiguredOr, addConfiguredRequirement, addConfiguredXor, addRequirement, getFilters, getRequiredIdentifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Requirements

public Requirements()
Creates a new device requirements list.


Requirements

public Requirements(Map buildProperties)
Cerates a new device requirements list.

Parameters:
buildProperties - the build properties
Method Detail

setMessage

public void setMessage(String message)

filterDevices

public Device[] filterDevices(Device[] availableDevices)
Filters the available devices and only returns those which satisfy all requirements.

Parameters:
availableDevices - array of all available devices.
Returns:
All devices which satisfy the requirements.

setIf

public void setIf(String ifExpr)
Sets the ant-property which needs to be defined to allow the execution of this task.

Parameters:
ifExpr - the ant-property which needs to be defined

setUnless

public void setUnless(String unlessExpr)
Sets the ant-property which must not be defined to allow the execution of this task.

Parameters:
unlessExpr - the ant-property which must not be defined

isActive

public boolean isActive(org.apache.tools.ant.Project project)
Checks if this element should be used.

Parameters:
project - The project to which this nested element belongs to.
Returns:
true when this element is valid

isActive

public boolean isActive(BooleanEvaluator evaluator)
Checks if this element should be used.

Parameters:
evaluator - the boolean evaluator.
Returns:
true when this element is valid