Save This Page
Home » apache-ant-1.8.1 » org.apache.tools » ant » types » selectors » [javadoc | source]
org.apache.tools.ant.types.selectors
abstract public class: BaseSelector [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.types.DataType
         org.apache.tools.ant.types.selectors.BaseSelector

All Implemented Interfaces:
    FileSelector, Cloneable

A convenience base class that you can subclass Selectors from. It provides some helpful common behaviour. Note that there is no need for Selectors to inherit from this class, it is only necessary that they implement FileSelector.
Fields inherited from org.apache.tools.ant.types.DataType:
ref,  checked
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Constructor:
 public BaseSelector() 
Method from org.apache.tools.ant.types.selectors.BaseSelector Summary:
getError,   isSelected,   setError,   validate,   verifySettings
Methods from org.apache.tools.ant.types.DataType:
checkAttributesAllowed,   checkChildrenAllowed,   circularReference,   clone,   dieOnCircularReference,   dieOnCircularReference,   dieOnCircularReference,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getDataTypeName,   getRefid,   invokeCircularReferenceCheck,   isChecked,   isReference,   noChildrenAllowed,   pushAndInvokeCircularReferenceCheck,   setChecked,   setRefid,   toString,   tooManyAttributes
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.types.selectors.BaseSelector Detail:
 public String getError() 
    Returns any error messages that have been set.
 abstract public boolean isSelected(File basedir,
    String filename,
    File file)
    Method that each selector will implement to create their selection behaviour. If there is a problem with the setup of a selector, it can throw a BuildException to indicate the problem.
 public  void setError(String msg) 
    Allows all selectors to indicate a setup error. Note that only the first error message is recorded.
 public  void validate() 
    Subclasses can use this to throw the requisite exception in isSelected() in the case of an error condition.
 public  void verifySettings() 

    Subclasses can override this method to provide checking of their state. So long as they call validate() from isSelected(), this will be called automatically (unless they override validate()).

    Implementations should check for incorrect settings and call setError() as necessary.