Class NameDiscoverers
java.lang.Object
org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
org.apache.commons.discovery.resource.names.NameDiscoverers
- All Implemented Interfaces:
ResourceNameDiscover
Holder for multiple ResourceNameDiscover instances.
The result is the union of the results from each
(not a chained sequence, where results feed the next in line.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourceNameDiscover
(ResourceNameDiscover discover) Specify an discover to be used in searching.findResourceNames
(String resourceName) Locate names of resources that are bound toresourceName
.protected ResourceNameDiscover
getResourceNameDiscover
(int idx) Retrieve the discover positioned at the given index.static void
setLog
(org.apache.commons.logging.Log _log) Deprecated.This method is not thread-safeprotected int
size()
Returns the current size of set discovers.Methods inherited from class org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
findResourceNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.discovery.ResourceNameDiscover
findResourceNames
-
Constructor Details
-
NameDiscoverers
public NameDiscoverers()Construct a new resource name discoverer
-
-
Method Details
-
setLog
Deprecated.This method is not thread-safeSets theLog
for this class.- Parameters:
_log
- This classLog
-
addResourceNameDiscover
Specify an discover to be used in searching. The order of discover determines the order of the result. It is recommended to add the most specific discover first.- Parameters:
discover
- The discover to be added
-
getResourceNameDiscover
Retrieve the discover positioned at the given index.- Parameters:
idx
- The discover index position client is requiring- Returns:
- The discover positioned at the input index
-
size
Returns the current size of set discovers.- Returns:
- The current size of set discovers
-
findResourceNames
Locate names of resources that are bound toresourceName
.- Specified by:
findResourceNames
in interfaceResourceNameDiscover
- Specified by:
findResourceNames
in classResourceNameDiscoverImpl
- Parameters:
resourceName
- The resource name to locate- Returns:
- A new
ResourceNameIterator
-