Class AbstractSelectorContainer
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.DataType
- 
- org.apache.tools.ant.types.selectors.AbstractSelectorContainer
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- SelectorContainer
 - Direct Known Subclasses:
- Files,- IsFileSelected
 
 public abstract class AbstractSelectorContainer extends DataType implements java.lang.Cloneable, SelectorContainer This is the a base class a container of selectors - it does not need do be a selector itself.- Since:
- 1.7
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractSelectorContainer()
 - 
Method SummaryModifier and Type Method Description voidadd(FileSelector selector)add an arbitrary selectorvoidaddAnd(AndSelector selector)add an "And" selector entry on the selector listvoidaddContains(ContainsSelector selector)add a contains selector entry on the selector listvoidaddContainsRegexp(ContainsRegexpSelector selector)add a regular expression selector entry on the selector listvoidaddCustom(ExtendSelector selector)add an extended selector entry on the selector listvoidaddDate(DateSelector selector)add a selector date entry on the selector listvoidaddDepend(DependSelector selector)add a depends selector entry on the selector listvoidaddDepth(DepthSelector selector)add a depth selector entry on the selector listvoidaddDifferent(DifferentSelector selector)adds a different selector to the selector listvoidaddExecutable(ExecutableSelector e)voidaddFilename(FilenameSelector selector)add a selector filename entry on the selector listvoidaddMajority(MajoritySelector selector)add a majority selector entry on the selector listvoidaddModified(ModifiedSelector selector)add the modified selectorvoidaddNone(NoneSelector selector)add a "None" selector entry on the selector listvoidaddNot(NotSelector selector)add a "Not" selector entry on the selector listvoidaddOr(OrSelector selector)add an "Or" selector entry on the selector listvoidaddOwnedBy(OwnedBySelector o)voidaddPosixGroup(PosixGroupSelector o)voidaddPosixPermissions(PosixPermissionsSelector o)voidaddPresent(PresentSelector selector)add a present selector entry on the selector listvoidaddReadable(ReadableSelector r)voidaddSelector(SelectSelector selector)add a "Select" selector entry on the selector listvoidaddSize(SizeSelector selector)add a selector size entry on the selector listvoidaddSymlink(SymlinkSelector e)voidaddType(TypeSelector selector)adds a type selector to the selector listvoidaddWritable(WritableSelector w)voidappendSelector(FileSelector selector)Add a new selector into this container.java.lang.Objectclone()Clone the selector container.protected voiddieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p)Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).FileSelector[]getSelectors(Project p)Returns the set of selectors as an array.booleanhasSelectors()Indicates whether there are any selectors here.intselectorCount()Gives the count of the number of selectors in this containerjava.util.Enumeration<FileSelector>selectorElements()Returns an enumerator for accessing the set of selectors.java.lang.StringtoString()Convert the Selectors within this container to a string.voidvalidate()This validates each contained selector provided that the selector implements the validate interface.- 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Method Detail- 
hasSelectorspublic boolean hasSelectors() Indicates whether there are any selectors here.- Specified by:
- hasSelectorsin interface- SelectorContainer
- Returns:
- true if there are selectors
 
 - 
selectorCountpublic int selectorCount() Gives the count of the number of selectors in this container- Specified by:
- selectorCountin interface- SelectorContainer
- Returns:
- the number of selectors
 
 - 
getSelectorspublic FileSelector[] getSelectors(Project p) Returns the set of selectors as an array.- Specified by:
- getSelectorsin interface- SelectorContainer
- Parameters:
- p- the current project
- Returns:
- an array of selectors
 
 - 
selectorElementspublic java.util.Enumeration<FileSelector> selectorElements() Returns an enumerator for accessing the set of selectors.- Specified by:
- selectorElementsin interface- SelectorContainer
- Returns:
- an enumerator for the selectors
 
 - 
toStringpublic java.lang.String toString() Convert the Selectors within this container to a string. This will just be a helper class for the subclasses that put their own name around the contents listed here.
 - 
appendSelectorpublic void appendSelector(FileSelector selector) Add a new selector into this container.- Specified by:
- appendSelectorin interface- SelectorContainer
- Parameters:
- selector- the new selector to add
 
 - 
validatepublic void validate() This validates each contained selector provided that the selector implements the validate interface. Ordinarily, this will validate all the elements of a selector container even if the isSelected() method of some elements is never called. This has two effects: - Validation will often occur twice.
- Since it is not required that selectors derive from BaseSelector, there could be selectors in the container whose error conditions are not detected if their isSelected() call is never made.
 
 - 
addSelectorpublic void addSelector(SelectSelector selector) add a "Select" selector entry on the selector list- Specified by:
- addSelectorin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addAndpublic void addAnd(AndSelector selector) add an "And" selector entry on the selector list- Specified by:
- addAndin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addOrpublic void addOr(OrSelector selector) add an "Or" selector entry on the selector list- Specified by:
- addOrin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addNotpublic void addNot(NotSelector selector) add a "Not" selector entry on the selector list- Specified by:
- addNotin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addNonepublic void addNone(NoneSelector selector) add a "None" selector entry on the selector list- Specified by:
- addNonein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addMajoritypublic void addMajority(MajoritySelector selector) add a majority selector entry on the selector list- Specified by:
- addMajorityin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addDatepublic void addDate(DateSelector selector) add a selector date entry on the selector list- Specified by:
- addDatein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addSizepublic void addSize(SizeSelector selector) add a selector size entry on the selector list- Specified by:
- addSizein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addFilenamepublic void addFilename(FilenameSelector selector) add a selector filename entry on the selector list- Specified by:
- addFilenamein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addCustompublic void addCustom(ExtendSelector selector) add an extended selector entry on the selector list- Specified by:
- addCustomin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addContainspublic void addContains(ContainsSelector selector) add a contains selector entry on the selector list- Specified by:
- addContainsin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addPresentpublic void addPresent(PresentSelector selector) add a present selector entry on the selector list- Specified by:
- addPresentin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addDepthpublic void addDepth(DepthSelector selector) add a depth selector entry on the selector list- Specified by:
- addDepthin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addDependpublic void addDepend(DependSelector selector) add a depends selector entry on the selector list- Specified by:
- addDependin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addDifferentpublic void addDifferent(DifferentSelector selector) adds a different selector to the selector list- Specified by:
- addDifferentin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addTypepublic void addType(TypeSelector selector) adds a type selector to the selector list- Specified by:
- addTypein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addContainsRegexppublic void addContainsRegexp(ContainsRegexpSelector selector) add a regular expression selector entry on the selector list- Specified by:
- addContainsRegexpin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
 - 
addModifiedpublic void addModified(ModifiedSelector selector) add the modified selector- Specified by:
- addModifiedin interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- ant 1.6
 
 - 
addReadablepublic void addReadable(ReadableSelector r) 
 - 
addWritablepublic void addWritable(WritableSelector w) 
 - 
addExecutablepublic void addExecutable(ExecutableSelector e) - Parameters:
- e- ExecutableSelector
- Since:
- 1.10.0
 
 - 
addSymlinkpublic void addSymlink(SymlinkSelector e) - Parameters:
- e- SymlinkSelector
- Since:
- 1.10.0
 
 - 
addOwnedBypublic void addOwnedBy(OwnedBySelector o) - Parameters:
- o- OwnedBySelector
- Since:
- 1.10.0
 
 - 
addPosixGrouppublic void addPosixGroup(PosixGroupSelector o) - Parameters:
- o- PosixGroupSelector
- Since:
- 1.10.4
 
 - 
addPosixPermissionspublic void addPosixPermissions(PosixPermissionsSelector o) - Parameters:
- o- PosixPermissionsSelector
- Since:
- 1.10.4
 
 - 
addpublic void add(FileSelector selector) add an arbitrary selector- Specified by:
- addin interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- Ant 1.6
 
 - 
dieOnCircularReferenceprotected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p)Description copied from class:DataTypeCheck to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).If one is included, throw a BuildException created by circularReference.This implementation is appropriate only for a DataType that cannot hold other DataTypes as children. The general contract of this method is that it shouldn't do anything if DataType.checkedis true and set it to true on exit.- Overrides:
- dieOnCircularReferencein class- DataType
- Parameters:
- stk- the stack of references to check.
- p- the project to use to dereference the references.
 
 
- 
 
-