Methods Summary |
---|
public void | add(FileSelector selector)add an arbitary selector
appendSelector(selector);
|
public void | addAnd(AndSelector selector)add an "And" selector entry on the selector list
appendSelector(selector);
|
public void | addContains(ContainsSelector selector)add a contains selector entry on the selector list
appendSelector(selector);
|
public void | addContainsRegexp(ContainsRegexpSelector selector)add a regular expression selector entry on the selector list
appendSelector(selector);
|
public void | addCustom(ExtendSelector selector)add an extended selector entry on the selector list
appendSelector(selector);
|
public void | addDate(DateSelector selector)add a selector date entry on the selector list
appendSelector(selector);
|
public void | addDepend(DependSelector selector)add a depends selector entry on the selector list
appendSelector(selector);
|
public void | addDepth(DepthSelector selector)add a depth selector entry on the selector list
appendSelector(selector);
|
public void | addDifferent(DifferentSelector selector)adds a different selector to the selector list
appendSelector(selector);
|
public void | addFilename(FilenameSelector selector)add a selector filename entry on the selector list
appendSelector(selector);
|
public void | addMajority(MajoritySelector selector)add a majority selector entry on the selector list
appendSelector(selector);
|
public void | addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector)add the modified selector
appendSelector(selector);
|
public void | addNone(NoneSelector selector)add a "None" selector entry on the selector list
appendSelector(selector);
|
public void | addNot(NotSelector selector)add a "Not" selector entry on the selector list
appendSelector(selector);
|
public void | addOr(OrSelector selector)add an "Or" selector entry on the selector list
appendSelector(selector);
|
public void | addPresent(PresentSelector selector)add a present selector entry on the selector list
appendSelector(selector);
|
public void | addSelector(SelectSelector selector)add a "Select" selector entry on the selector list
appendSelector(selector);
|
public void | addSize(SizeSelector selector)add a selector size entry on the selector list
appendSelector(selector);
|
public void | addType(TypeSelector selector)adds a type selector to the selector list
appendSelector(selector);
|
public void | appendSelector(FileSelector selector)Add a new selector into this container.
selectorsList.addElement(selector);
|
public FileSelector[] | getSelectors(org.apache.tools.ant.Project p)Returns the set of selectors as an array.
FileSelector[] result = new FileSelector[selectorsList.size()];
selectorsList.copyInto(result);
return result;
|
public boolean | hasSelectors()Indicates whether there are any selectors here.
return !(selectorsList.isEmpty());
|
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.
|
public int | selectorCount()Gives the count of the number of selectors in this container
return selectorsList.size();
|
public java.util.Enumeration | selectorElements()Returns an enumerator for accessing the set of selectors.
return selectorsList.elements();
|
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.
StringBuffer buf = new StringBuffer();
Enumeration e = selectorElements();
if (e.hasMoreElements()) {
while (e.hasMoreElements()) {
buf.append(e.nextElement().toString());
if (e.hasMoreElements()) {
buf.append(", ");
}
}
}
return buf.toString();
|
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.
verifySettings();
String errmsg = getError();
if (errmsg != null) {
throw new BuildException(errmsg);
}
Enumeration e = selectorElements();
while (e.hasMoreElements()) {
Object o = e.nextElement();
if (o instanceof BaseSelector) {
((BaseSelector) o).validate();
}
}
|