Class ExtendSelector
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.ExtendSelector
- All Implemented Interfaces:
- Cloneable,- ResourceSelector,- FileSelector
Selector that selects files by forwarding the request on to other classes.
- Since:
- 1.5
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCreate new parameters to pass to custom selector.final PathSpecify the classpath to use to load the Selector (nested element).final PathGet the classpathbooleanisSelected(File basedir, String filename, File file) Allows the custom selector to choose whether to select a file.voidInstantiates the identified custom selector class.voidsetClassname(String classname) Sets the classname of the custom selector.final voidsetClasspath(Path classpath) Set the classpath to load the classname specified using an attribute.voidSet the classpath to use for loading a custom selector by using a reference.voidThese are errors specific to ExtendSelector only.Methods inherited from class org.apache.tools.ant.types.selectors.BaseSelectorgetError, setError, setError, validateMethods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toStringMethods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tools.ant.types.selectors.FileSelectorisSelected
- 
Constructor Details- 
ExtendSelectorpublic ExtendSelector()
 
- 
- 
Method Details- 
setClassnameSets the classname of the custom selector.- Parameters:
- classname- is the class which implements this selector
 
- 
selectorCreatepublic void selectorCreate()Instantiates the identified custom selector class.
- 
addParamCreate new parameters to pass to custom selector.- Parameters:
- p- The new Parameter object
 
- 
setClasspathSet the classpath to load the classname specified using an attribute.- Parameters:
- classpath- the classpath to use
 
- 
createClasspathSpecify the classpath to use to load the Selector (nested element).- Returns:
- a classpath to be configured
 
- 
getClasspath
- 
setClasspathrefSet the classpath to use for loading a custom selector by using a reference.- Parameters:
- r- a reference to the classpath
 
- 
verifySettingspublic void verifySettings()These are errors specific to ExtendSelector only. If there are errors in the custom selector, it should throw a BuildException when isSelected() is called.- Overrides:
- verifySettingsin class- BaseSelector
 
- 
isSelectedAllows the custom selector to choose whether to select a file. This is also where the Parameters are passed to the custom selector, since we know we must have them all by now. And since we must know both classpath and classname, creating the class is deferred to here as well.- Specified by:
- isSelectedin interface- FileSelector
- Specified by:
- isSelectedin class- BaseSelector
- Parameters:
- basedir- The the base directory.
- filename- The name of the file to check.
- file- A File object for this filename.
- Returns:
- whether the file should be selected or not.
- Throws:
- BuildException- if an error occurs.
 
 
-