ColdBox Platform Version 2.6.3

coldbox.system.plugins
Class resourceBundle

WEB-INF.cftags.component
        extended by coldbox.system.frameworkSupertype
            extended by coldbox.system.plugin
                extended by coldbox.system.plugins.resourceBundle

public class resourceBundle
extends plugin

reads and parses java resource bundle per locale: version 1.0.0 coldbox core java 8-jul-2006 paul@sustainableGIS.com


Constructor Summary
init(any controller)
          Constructor
 
Method Summary
 string formatRBString(string rbString, any substituteValues)
          performs messageFormat like operation on compound rb string
 array getRBKeys(any rbFile, [any rbLocale='en_US'])
          returns array of keys in java resource bundle per locale
 any getRBString(any rbFile, any rbKey, [any rbLocale='en_US'])
          returns text for given key in given java resource bundle per locale
 any getResource(any resource)
          Returns bundle resource from loaded bundle, if it exists, according to locale. To get a resource string from non loaded RB's, use getRBString
 any getResourceBundle(any rbFile, [any rbLocale='en_US'])
          Reads,parses and RETURNS a resource bundle in structure format
 struct getVersion()
           returns version of this CFC and java lib it uses.
 void loadBundle(string rbFile, [string rbLocale='en_US'])
          Reads,parses and saves the resource bundle per locale in internal ColdBox structures.
 string messageFormat(string thisPattern, any args, [any thisLocale='en_US'])
          performs messageFormat on compound rb string
private void setupInstance()
          Sets up the instance objects for usage. Pulled from init for performance.
 boolean verifyPattern(string pattern)
          performs verification on MessageFormat pattern
 
Methods inherited from class coldbox.system.plugin
getPluginDescription, getPluginName, getPluginVersion, getpluginPath, setPluginDescription, setPluginName, setPluginVersion
 
Methods inherited from class coldbox.system.frameworkSupertype
abort, announceInterception, dump, getColdboxOCM, getDatasource, getDebugMode, getHash, getInstance, getInterceptor, getMailSettings, getModel, getMyPlugin, getPlugin, getSetting, getSettingStructure, getSettingsBean, getcontroller, getfwLocale, htmlhead, include, includeUDF, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderView, rethrowit, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setcontroller, settingExists, throw
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any controller)

Method Detail

formatRBString

public string formatRBString(string rbString, any substituteValues)
performs messageFormat like operation on compound rb string

Parameters:
rbString
substituteValues - Array or single value to format.

getRBKeys

public array getRBKeys(any rbFile, [any rbLocale='en_US'])
returns array of keys in java resource bundle per locale

Parameters:
rbFile - This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.
rbLocale - The locale to use.

getRBString

public any getRBString(any rbFile, any rbKey, [any rbLocale='en_US'])
returns text for given key in given java resource bundle per locale

Parameters:
rbFile - This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.
rbKey - The key to retrieve
rbLocale - The locale of the bundle. Default is en_US

getResource

public any getResource(any resource)
Returns bundle resource from loaded bundle, if it exists, according to locale. To get a resource string from non loaded RB's, use getRBString

Overrides:
getResource in class frameworkSupertype
Parameters:
resource - The resource to retrieve from the loaded bundle.

getResourceBundle

public any getResourceBundle(any rbFile, [any rbLocale='en_US'])
Reads,parses and RETURNS a resource bundle in structure format

Parameters:
rbFile - This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.
rbLocale - The locale of the resource bundle

getVersion

public struct getVersion()
returns version of this CFC and java lib it uses.


loadBundle

public void loadBundle(string rbFile, [string rbLocale='en_US'])
Reads,parses and saves the resource bundle per locale in internal ColdBox structures.

Parameters:
rbFile - This must be the path + filename UP to but NOT including the locale. We auto-add .properties to the end.
rbLocale

messageFormat

public string messageFormat(string thisPattern, any args, [any thisLocale='en_US'])
performs messageFormat on compound rb string

Parameters:
thisPattern - pattern to use in formatting
args - substitution values
thisLocale - locale to use in formatting, defaults to en_US

setupInstance

private void setupInstance()
Sets up the instance objects for usage. Pulled from init for performance.


verifyPattern

public boolean verifyPattern(string pattern)
performs verification on MessageFormat pattern

Parameters:
pattern - format pattern to test

ColdBox Platform Version 2.6.3