Save This Page
Home » apache-ant-1.8.1 » » ant » types » selectors » [javadoc | source]
abstract public class: BaseSelector [javadoc | source]

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
ref,  checked
Fields inherited from
project,  location,  description
 public BaseSelector() 
Method from Summary:
getError,   isSelected,   setError,   validate,   verifySettings
Methods from
checkAttributesAllowed,   checkChildrenAllowed,   circularReference,   clone,   dieOnCircularReference,   dieOnCircularReference,   dieOnCircularReference,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getCheckedRef,   getDataTypeName,   getRefid,   invokeCircularReferenceCheck,   isChecked,   isReference,   noChildrenAllowed,   pushAndInvokeCircularReferenceCheck,   setChecked,   setRefid,   toString,   tooManyAttributes
Methods from
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 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.