Class BaseSelectorContainer

    • Constructor Detail

      • BaseSelectorContainer

        public BaseSelectorContainer()
    • Method Detail

      • hasSelectors

        public boolean hasSelectors()
        Indicates whether there are any selectors here.
        Specified by:
        hasSelectors in interface SelectorContainer
        Returns:
        true if there are selectors
      • selectorCount

        public int selectorCount()
        Gives the count of the number of selectors in this container
        Specified by:
        selectorCount in interface SelectorContainer
        Returns:
        the number of selectors
      • selectorElements

        public java.util.Enumeration<FileSelector> selectorElements()
        Returns an enumerator for accessing the set of selectors.
        Specified by:
        selectorElements in interface SelectorContainer
        Returns:
        an enumerator for the selectors
      • toString

        public 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.
        Overrides:
        toString in class DataType
        Returns:
        comma separated list of Selectors contained in this one
      • appendSelector

        public void appendSelector​(FileSelector selector)
        Add a new selector into this container.
        Specified by:
        appendSelector in interface SelectorContainer
        Parameters:
        selector - the new selector to add
      • validate

        public void validate()

        This implementation validates the container by calling verifySettings() and then 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.
        Overrides:
        validate in class BaseSelector
      • isSelected

        public abstract boolean isSelected​(java.io.File basedir,
                                           java.lang.String filename,
                                           java.io.File file)
        Method that each selector will implement to create their selection behaviour. This is what makes SelectorContainer abstract.
        Specified by:
        isSelected in interface FileSelector
        Specified by:
        isSelected in class BaseSelector
        Parameters:
        basedir - the base directory the scan is being done from
        filename - the name of the file to check
        file - a java.io.File object for the filename that the selector can use
        Returns:
        whether the file should be selected or not
      • addSelector

        public void addSelector​(SelectSelector selector)
        add a "Select" selector entry on the selector list
        Specified by:
        addSelector in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addAnd

        public void addAnd​(AndSelector selector)
        add an "And" selector entry on the selector list
        Specified by:
        addAnd in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addOr

        public void addOr​(OrSelector selector)
        add an "Or" selector entry on the selector list
        Specified by:
        addOr in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addNot

        public void addNot​(NotSelector selector)
        add a "Not" selector entry on the selector list
        Specified by:
        addNot in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addNone

        public void addNone​(NoneSelector selector)
        add a "None" selector entry on the selector list
        Specified by:
        addNone in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addMajority

        public void addMajority​(MajoritySelector selector)
        add a majority selector entry on the selector list
        Specified by:
        addMajority in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addDate

        public void addDate​(DateSelector selector)
        add a selector date entry on the selector list
        Specified by:
        addDate in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addSize

        public void addSize​(SizeSelector selector)
        add a selector size entry on the selector list
        Specified by:
        addSize in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addFilename

        public void addFilename​(FilenameSelector selector)
        add a selector filename entry on the selector list
        Specified by:
        addFilename in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addCustom

        public void addCustom​(ExtendSelector selector)
        add an extended selector entry on the selector list
        Specified by:
        addCustom in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addContains

        public void addContains​(ContainsSelector selector)
        add a contains selector entry on the selector list
        Specified by:
        addContains in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addPresent

        public void addPresent​(PresentSelector selector)
        add a present selector entry on the selector list
        Specified by:
        addPresent in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addDepth

        public void addDepth​(DepthSelector selector)
        add a depth selector entry on the selector list
        Specified by:
        addDepth in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addDepend

        public void addDepend​(DependSelector selector)
        add a depends selector entry on the selector list
        Specified by:
        addDepend in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addType

        public void addType​(TypeSelector selector)
        adds a type selector to the selector list
        Specified by:
        addType in interface SelectorContainer
        Parameters:
        selector - the selector to add
      • addExecutable

        public void addExecutable​(ExecutableSelector e)
        Parameters:
        e - ExecutableSelector
        Since:
        1.10.0
      • addSymlink

        public void addSymlink​(SymlinkSelector e)
        Parameters:
        e - SymlinkSelector
        Since:
        1.10.0
      • addOwnedBy

        public void addOwnedBy​(OwnedBySelector o)
        Parameters:
        o - OwnedBySelector
        Since:
        1.10.0
      • addPosixGroup

        public void addPosixGroup​(PosixGroupSelector o)
        Parameters:
        o - PosixGroupSelector
        Since:
        1.10.4
      • addPosixPermissions

        public void addPosixPermissions​(PosixPermissionsSelector o)
        Parameters:
        o - PosixPermissionsSelector
        Since:
        1.10.4
      • add

        public void add​(FileSelector selector)
        add an arbitrary selector
        Specified by:
        add in interface SelectorContainer
        Parameters:
        selector - the selector to add
        Since:
        Ant 1.6
      • dieOnCircularReference

        protected void dieOnCircularReference​(java.util.Stack<java.lang.Object> stk,
                                              Project p)
                                       throws BuildException
        Description copied from class: DataType
        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).

        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.checked is true and set it to true on exit.

        Overrides:
        dieOnCircularReference in class DataType
        Parameters:
        stk - the stack of references to check.
        p - the project to use to dereference the references.
        Throws:
        BuildException - on error.