Methods Summary |
---|
public synchronized void | add(org.apache.tools.ant.types.ResourceCollection c)Add a ResourceCollection to the container.
if (isReference()) {
throw noChildrenAllowed();
}
if (c == null) {
return;
}
if (rc != null) {
throw oneNested();
}
rc = c;
setChecked(false);
|
private synchronized java.util.Collection | cacheCollection()
if (coll == null || !isCache()) {
coll = getCollection();
}
return coll;
|
protected synchronized void | dieOnCircularReference(java.util.Stack stk, org.apache.tools.ant.Project p)Overrides the version of DataType to recurse on all DataType
child elements that may have been added.
if (isChecked()) {
return;
}
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
if (rc instanceof DataType) {
stk.push(rc);
invokeCircularReferenceCheck((DataType) rc, stk, p);
stk.pop();
}
setChecked(true);
}
|
protected abstract java.util.Collection | getCollection()Template method for subclasses to return a Collection of Resources.
|
protected final synchronized org.apache.tools.ant.types.ResourceCollection | getResourceCollection()Get the nested ResourceCollection.
dieOnCircularReference();
if (rc == null) {
throw oneNested();
}
return rc;
|
public synchronized boolean | isCache()Learn whether to cache collections. Default is true .
return cache;
|
public synchronized boolean | isFilesystemOnly()Fulfill the ResourceCollection contract.
if (isReference()) {
return ((BaseResourceCollectionContainer) getCheckedRef()).isFilesystemOnly();
}
dieOnCircularReference();
if (rc == null || rc.isFilesystemOnly()) {
return true;
}
/* now check each Resource in case the child only
lets through files from any children IT may have: */
for (Iterator i = cacheCollection().iterator(); i.hasNext();) {
if (!(i.next() instanceof FileResource)) {
return false;
}
}
return true;
|
public final synchronized java.util.Iterator | iterator()Fulfill the ResourceCollection contract.
if (isReference()) {
return ((BaseResourceCollectionWrapper) getCheckedRef()).iterator();
}
dieOnCircularReference();
return new FailFast(this, cacheCollection().iterator());
|
private org.apache.tools.ant.BuildException | oneNested()
return new BuildException(super.toString() + ONE_NESTED_MESSAGE);
|
public synchronized void | setCache(boolean b)Set whether to cache collections.
cache = b;
|
public synchronized int | size()Fulfill the ResourceCollection contract.
if (isReference()) {
return ((BaseResourceCollectionWrapper) getCheckedRef()).size();
}
dieOnCircularReference();
return cacheCollection().size();
|
public synchronized java.lang.String | toString()Format this BaseResourceCollectionWrapper as a String.
if (isReference()) {
return getCheckedRef().toString();
}
if (cacheCollection().size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer();
for (Iterator i = coll.iterator(); i.hasNext();) {
if (sb.length() > 0) {
sb.append(File.pathSeparatorChar);
}
sb.append(i.next());
}
return sb.toString();
|