Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.util
Class LocalizedResourceFinder  view LocalizedResourceFinder download LocalizedResourceFinder.java

java.lang.Object
  extended byorg.apache.hivemind.util.LocalizedResourceFinder

public class LocalizedResourceFinder
extends java.lang.Object

Searches for a localization of a particular resource in the classpath (using a org.apache.hivemind.ClassResolver.


Field Summary
private  org.apache.hivemind.ClassResolver _resolver
           
 
Constructor Summary
LocalizedResourceFinder(org.apache.hivemind.ClassResolver resolver)
           
 
Method Summary
 LocalizedResource resolve(java.lang.String resourcePath, java.util.Locale locale)
          Resolves the resource, returning a path representing the closest match (with respect to the provided locale).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_resolver

private org.apache.hivemind.ClassResolver _resolver
Constructor Detail

LocalizedResourceFinder

public LocalizedResourceFinder(org.apache.hivemind.ClassResolver resolver)
Method Detail

resolve

public LocalizedResource resolve(java.lang.String resourcePath,
                                 java.util.Locale locale)
Resolves the resource, returning a path representing the closest match (with respect to the provided locale). Returns null if no match.

The provided path is split into a base path and a suffix (at the last period character). The locale will provide different suffixes to the base path and the first match is returned.