|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pf.nls.NLSIniFileDetector
public class NLSIniFileDetector
This class is responsible to lookup the classpath for a specified base name to which it depends the file extension ".ini". All found files are read to retrieve the included metadata which defines which texts for which locale can be found in which file. Eventually it provides a FileLocator per locale which allows to load the associated texts with a NLSIniFileLoader.
Field Summary | |
---|---|
static boolean |
DEBUG
|
static String |
DEFAULT_FILE_EXTENSTION
|
Constructor Summary | |
---|---|
NLSIniFileDetector()
Initialize the new instance with default values. |
Method Summary | |
---|---|
boolean |
detect(String baseName)
Detects all meta information files for the given base name on the current NLS lookup path. |
org.pf.file.FileLocator |
getFileForLocales(Locale locale)
Returns the file locator for the given locale or null if not found. |
org.pf.file.FileLocator[] |
getFilesForLocales(Locale[] locales)
Returns a file locators for wich a mapping to the given locales have been found. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
public static final String DEFAULT_FILE_EXTENSTION
Constructor Detail |
---|
public NLSIniFileDetector()
Method Detail |
---|
public boolean detect(String baseName)
This path usually is the classpath. However, it can explicitly set with -Dorg.pf.nls.path=any classpath.
After calling this method the getFilesForLocales() can be used to get the names of the file that contain the NLS text data.
baseName
- The filename without file extension (".ini" will be appended)
public org.pf.file.FileLocator[] getFilesForLocales(Locale[] locales)
This method should be called only after detect() has been called at least once before.
locales
- The locales for which to return the corresponding file locatorspublic org.pf.file.FileLocator getFileForLocales(Locale locale)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |