Methods Summary |
---|
public void | appendSelector(FileSelector selector)Add a new selector into this container.
if (isReference()) {
throw noChildrenAllowed();
}
super.appendSelector(selector);
|
private org.apache.tools.ant.types.selectors.SelectSelector | getRef()Performs the check for circular references and returns the
referenced Selector.
Object o = getCheckedRef(this.getClass(), "SelectSelector");
return (SelectSelector) o;
|
public FileSelector[] | getSelectors(org.apache.tools.ant.Project p)Returns the set of selectors as an array.
if (isReference()) {
return getRef().getSelectors(p);
}
return super.getSelectors(p);
|
public boolean | hasSelectors()Indicates whether there are any selectors here.
if (isReference()) {
return getRef().hasSelectors();
}
return super.hasSelectors();
|
public boolean | isSelected(java.io.File basedir, java.lang.String filename, java.io.File file)Returns true (the file is selected) only if the if property (if any)
exists, the unless property (if any) doesn't exist, and the
contained selector (if any) selects the file. If there is no contained
selector, return true (because we assume that the point was to test
the if and unless conditions).
validate();
// Deal with if and unless properties first
if (!(passesConditions())) {
return false;
}
Enumeration e = selectorElements();
if (!(e.hasMoreElements())) {
return true;
}
FileSelector f = (FileSelector) e.nextElement();
return f.isSelected(basedir, filename, file);
|
public boolean | passesConditions()Ensures that the selector passes the conditions placed
on it with if and unless .
if (ifProperty != null
&& getProject().getProperty(ifProperty) == null) {
return false;
} else if (unlessProperty != null
&& getProject().getProperty(unlessProperty) != null) {
return false;
}
return true;
|
public int | selectorCount()Gives the count of the number of selectors in this container
if (isReference()) {
return getRef().selectorCount();
}
return super.selectorCount();
|
public java.util.Enumeration | selectorElements()Returns an enumerator for accessing the set of selectors.
if (isReference()) {
return getRef().selectorElements();
}
return super.selectorElements();
|
public void | setIf(java.lang.String ifProperty)Sets the if attribute to a property which must exist for the
selector to select any files.
this.ifProperty = ifProperty;
|
public void | setUnless(java.lang.String unlessProperty)Sets the unless attribute to a property which cannot exist for the
selector to select any files.
this.unlessProperty = unlessProperty;
|
public java.lang.String | toString()
StringBuffer buf = new StringBuffer();
if (hasSelectors()) {
buf.append("{select");
if (ifProperty != null) {
buf.append(" if: ");
buf.append(ifProperty);
}
if (unlessProperty != null) {
buf.append(" unless: ");
buf.append(unlessProperty);
}
buf.append(" ");
buf.append(super.toString());
buf.append("}");
}
return buf.toString();
|
public void | verifySettings()Makes sure that there is only one entry, sets an error message if
not.
int cnt = selectorCount();
if (cnt < 0 || cnt > 1) {
setError("Only one selector is allowed within the "
+ "<selector> tag");
}
|