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

All Implemented Interfaces:
    FileSelector, Cloneable

Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).
Nested Class Summary:
public static class  PresentSelector.FilePresence  Enumerated attribute with the values for indicating where a file's presence is allowed and required. 
Fields inherited from org.apache.tools.ant.types.DataType:
ref,  checked
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Constructor:
 public PresentSelector() 
Method from org.apache.tools.ant.types.selectors.PresentSelector Summary:
addConfigured,   createMapper,   isSelected,   setPresent,   setTargetdir,   toString,   verifySettings
Methods from org.apache.tools.ant.types.selectors.BaseSelector:
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.PresentSelector Detail:
 public  void addConfigured(FileNameMapper fileNameMapper) 
    Add a configured FileNameMapper instance.
 public Mapper createMapper() throws BuildException 
    Defines the FileNameMapper to use (nested mapper element).
 public boolean isSelected(File basedir,
    String filename,
    File file) 
    The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.
 public  void setPresent(FilePresence fp) 
    This sets whether to select a file if its dest file is present. It could be a negate boolean, but by doing things this way, we get some documentation on how the system works. A user looking at the documentation should clearly understand that the ONLY files whose presence is being tested are those that already exist in the source directory, hence the lack of a destonly option.
 public  void setTargetdir(File targetdir) 
    The name of the file or directory which is checked for matching files.
 public String toString() 
 public  void verifySettings() 
    Checks to make sure all settings are kosher. In this case, it means that the targetdir attribute has been set and we have a mapper.