Browse Source

Support cache attribute for <restrict>; delegate to component BaseRCWrapper.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278496 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
9130ea784d
2 changed files with 29 additions and 0 deletions
  1. +13
    -0
      docs/manual/CoreTypes/resources.html
  2. +16
    -0
      src/main/org/apache/tools/ant/types/resources/Restrict.java

+ 13
- 0
docs/manual/CoreTypes/resources.html View File

@@ -324,6 +324,19 @@ platforms.
<h4><a name="restrict">restrict</a></h4>
<p>Restricts another nested resource collection using resource selectors:
<blockquote>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">cache</td>
<td valign="top">Whether to cache results; disabling
may seriously impact performance</td>
<td valign="top" align="center">No, default <i>true</i></td>
</tr>
</table>
<h4>Parameters specified as nested elements</h4>
<p>A single resource collection is required.</p>
<p>Nested resource selectors are used to "narrow down" the included


+ 16
- 0
src/main/org/apache/tools/ant/types/resources/Restrict.java View File

@@ -67,6 +67,22 @@ outer: for (Iterator ri = w.getResourceCollection().iterator(); ri.hasNext(
w.add(c);
}

/**
* Set whether to cache collections.
* @param b boolean cache flag.
*/
public synchronized void setCache(boolean b) {
w.setCache(b);
}

/**
* Learn whether to cache collections. Default is <code>true</code>.
* @return boolean cache flag.
*/
public synchronized boolean isCache() {
return w.isCache();
}

/**
* Add a ResourceSelector.
* @param s the ResourceSelector to add.


Loading…
Cancel
Save