Class DiscoverNamesInDictionary
- java.lang.Object
-
- org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
-
- org.apache.commons.discovery.resource.names.DiscoverNamesInDictionary
-
- All Implemented Interfaces:
ResourceNameDiscover
public class DiscoverNamesInDictionary extends ResourceNameDiscoverImpl implements ResourceNameDiscover
Recover resources from a Dictionary. This covers Properties as well, sinceProperties extends Hashtable extends Dictionary
. The recovered value is expected to be either aString
or aString[]
.
-
-
Constructor Summary
Constructors Constructor Description DiscoverNamesInDictionary()
Construct a new resource discoverer with an empty Dictionary.DiscoverNamesInDictionary(java.util.Dictionary<java.lang.String,java.lang.String[]> dictionary)
Construct a new resource discoverer with the given Dictionary.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addResource(java.lang.String resourceName, java.lang.String resource)
Add a resource name to a single name mapping.void
addResource(java.lang.String resourceName, java.lang.String[] resources)
Add a resource name to multiple names mapping.ResourceNameIterator
findResourceNames(java.lang.String resourceName)
Locate names of resources that are bound toresourceName
.protected java.util.Dictionary<java.lang.String,java.lang.String[]>
getDictionary()
Returns the current Dictionary for names mapping.void
setDictionary(java.util.Dictionary<java.lang.String,java.lang.String[]> table)
Specify the Dictionary for names mapping.static void
setLog(org.apache.commons.logging.Log _log)
Deprecated.This method is not thread-safe-
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 Detail
-
DiscoverNamesInDictionary
public DiscoverNamesInDictionary()
Construct a new resource discoverer with an empty Dictionary.
-
DiscoverNamesInDictionary
public DiscoverNamesInDictionary(java.util.Dictionary<java.lang.String,java.lang.String[]> dictionary)
Construct a new resource discoverer with the given Dictionary.- Parameters:
dictionary
- The initial Dictionary
-
-
Method Detail
-
setLog
@Deprecated public static void setLog(org.apache.commons.logging.Log _log)
Deprecated.This method is not thread-safeSets theLog
for this class.- Parameters:
_log
- This classLog
-
getDictionary
protected java.util.Dictionary<java.lang.String,java.lang.String[]> getDictionary()
Returns the current Dictionary for names mapping.- Returns:
- The current Dictionary for names mapping
-
setDictionary
public void setDictionary(java.util.Dictionary<java.lang.String,java.lang.String[]> table)
Specify the Dictionary for names mapping.- Parameters:
table
- The Dictionary for names mapping
-
addResource
public void addResource(java.lang.String resourceName, java.lang.String resource)
Add a resource name to a single name mapping.- Parameters:
resourceName
- The resource nameresource
- The target name
-
addResource
public void addResource(java.lang.String resourceName, java.lang.String[] resources)
Add a resource name to multiple names mapping.- Parameters:
resourceName
- The resource nameresources
- The target names
-
findResourceNames
public ResourceNameIterator findResourceNames(java.lang.String resourceName)
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
-
-