/** * Fulfill the ResourceCollection contract. * @return whether this is a filesystem-only resource collection. */ @Override public synchronized boolean isFilesystemOnly() { if (isReference()) { return getCheckedRef().isFilesystemOnly(); } dieOnCircularReference(); return w.isFilesystemOnly(); }
/** * Get the string representation of this Resource. * @return this Resource formatted as a String. * @since Ant 1.7 */ @Override public String toString() { return getCompressionName() + " compressed " + super.toString(); }
/** * Set the archive that holds this Resource. * @param a the archive as a File. */ public void setArchive(File a) { checkAttributesAllowed(); archive = new FileResource(a); }
/** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. */ @Override public Iterator<Resource> iterator() { if (isReference()) { return ((MultiRootFileSet) getRef(getProject())).iterator(); } return merge().iterator(); }
/** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. */ @Override public final synchronized Iterator<Resource> iterator() { if (isReference()) { return ((AbstractResourceCollectionWrapper) getCheckedRef()).iterator(); } dieOnCircularReference(); return new FailFast(this, createIterator()); }
/** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. */ @Override public final synchronized Iterator<Resource> iterator() { if (isReference()) { return getCheckedRef().iterator(); } dieOnCircularReference(); return w.iterator(); }
/** * Fulfill the ResourceCollection contract. * @return number of elements as int. */ @Override public int size() { if (isReference()) { return ((MultiRootFileSet) getRef(getProject())).size(); } return merge().size(); }
/** * Fulfill the ResourceCollection contract. * @return number of elements as int. */ @Override public synchronized int size() { if (isReference()) { return getCheckedRef().size(); } dieOnCircularReference(); return w.size(); }
/** * Format this Restrict collection as a String. * @return the String value of this collection. */ @Override public synchronized String toString() { if (isReference()) { return getCheckedRef().toString(); } dieOnCircularReference(); return w.toString(); }
/** * Add the ResourceCollection. * @param c the ResourceCollection to add. */ public synchronized void add(ResourceCollection c) { if (isReference()) { throw noChildrenAllowed(); } if (c == null) { return; } w.add(c); setChecked(false); }
/** * Adds a collection of resources to style in addition to the * given file or the implicit fileset. * * @param rc the collection of resources to style * @since Ant 1.7 */ public void add(final ResourceCollection rc) { resources.add(rc); }
/** * Create a nested sources element. * @return a Union instance. */ public synchronized Union createSources() { sources = (sources == null) ? new Union() : sources; return sources; }
/** * Overrides the super version. * @param r the Reference to set. */ public void setRefid(Reference r) { if (encoding != null) { throw tooManyAttributes(); } super.setRefid(r); }
/** * Not really supported since mapper is never null. * @param r reference to set */ @Override public void setRefid(Reference r) { if (mapper != null) { throw noChildrenAllowed(); } super.setRefid(r); }
private synchronized void validate() { dieOnCircularReference(); coll = (coll == null) ? new MyCollection() : coll; }