Class DiscoverMappedNames

java.lang.Object
org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
org.apache.commons.discovery.resource.names.DiscoverMappedNames
All Implemented Interfaces:
ResourceNameDiscover

public class DiscoverMappedNames extends ResourceNameDiscoverImpl implements ResourceNameDiscover
Recover resource name from Managed Properties, using OLD property names. This class maintains a mapping between old names and (new) the class names they represent. The discovery mechanism uses the class names as property names.
See Also:
  • Field Details

    • log

      private static org.apache.commons.logging.Log log
    • mapping

      private final Map<String,String[]> mapping
      The String name ==> String[] newNames mapping
  • Constructor Details

    • DiscoverMappedNames

      public DiscoverMappedNames()
      Construct a new resource discoverer
  • Method Details

    • setLog

      @Deprecated public static void setLog(org.apache.commons.logging.Log _log)
      Deprecated.
      This method is not thread-safe
      Sets the Log for this class.
      Parameters:
      _log - This class Log
    • map

      public void map(String fromName, String toName)
      Maps a name to another name.
      Parameters:
      fromName - The name has to be mapped
      toName - The mapping target
    • map

      public void map(String fromName, String[] toNames)
      Maps a name to multiple names.
      Parameters:
      fromName - The name has to be mapped
      toNames - The mapping targets
    • findResourceNames

      public ResourceNameIterator findResourceNames(String resourceName)
      Locate names of resources that are bound to resourceName.
      Specified by:
      findResourceNames in interface ResourceNameDiscover
      Specified by:
      findResourceNames in class ResourceNameDiscoverImpl
      Parameters:
      resourceName - The resource name to locate
      Returns:
      A new ResourceNameIterator