public class PresentSelector extends BaseSelector
Modifier and Type | Class and Description |
---|---|
static class |
PresentSelector.FilePresence
Enumerated attribute with the values for indicating where a file's
presence is allowed and required.
|
description, location, project
Constructor and Description |
---|
PresentSelector()
Creates a new
PresentSelector instance. |
Modifier and Type | Method and Description |
---|---|
void |
addConfigured(FileNameMapper fileNameMapper)
Add a configured FileNameMapper instance.
|
Mapper |
createMapper()
Defines the FileNameMapper to use (nested mapper element).
|
boolean |
isSelected(java.io.File basedir,
java.lang.String filename,
java.io.File file)
The heart of the matter.
|
void |
setPresent(PresentSelector.FilePresence fp)
This sets whether to select a file if its dest file is present.
|
void |
setTargetdir(java.io.File targetdir)
The name of the file or directory which is checked for matching
files.
|
java.lang.String |
toString()
Basic DataType toString().
|
void |
verifySettings()
Checks to make sure all settings are kosher.
|
getError, setError, setError, validate
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
public java.lang.String toString()
DataType
public void setTargetdir(java.io.File targetdir)
targetdir
- the directory to scan looking for matching files.public Mapper createMapper() throws BuildException
BuildException
- if more than one mapper definedpublic void addConfigured(FileNameMapper fileNameMapper)
fileNameMapper
- the FileNameMapper to addBuildException
- if more than one mapper definedpublic void setPresent(PresentSelector.FilePresence fp)
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.fp
- An attribute set to either srconly
or
both
.public void verifySettings()
verifySettings
in class BaseSelector
public boolean isSelected(java.io.File basedir, java.lang.String filename, java.io.File file)
isSelected
in interface FileSelector
isSelected
in class BaseSelector
basedir
- the base directory the scan is being done fromfilename
- is the name of the file to checkfile
- is a java.io.File object the selector can use