|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary<K,V> java.util.Hashtable<String,String> com.jalios.util.JProperties com.jalios.util.LangProperties
public class LangProperties
Field Summary | |
---|---|
protected String |
defaultLangPrefix
|
static String |
REVISION
|
Fields inherited from class com.jalios.util.JProperties |
---|
listenerSet, propertyNameAsDefaultValue |
Constructor Summary | |
---|---|
LangProperties()
|
Method Summary | |
---|---|
String |
format(String format,
Object[] objects)
This is a temporary implementation waiting for a more powerful Format. |
String |
format(String format,
Object[] objects,
String language)
This is a temporary implementation waiting for a more powerful Format. |
String |
getExplicitLangProperty(LangProperty prop,
String language)
Resolve the given property name using the given language. |
String |
getExplicitLangProperty(String name,
String language,
Object[] formArgs)
Resolve the given property name using the given language. |
String |
getLangProperty(String name,
Object... formArgs)
Resolve the given property name using the default language prefix. |
String[] |
getLangStringArrayProperty(String name,
String[] defaultValue)
|
JProperties |
getProperties(String prefix)
Returns a new property set of properties with key matching a given prefix. |
void |
setDefaultLangPrefix(String langPrefix)
Define the default lang prefix to use when looking for a language property. |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected String defaultLangPrefix
Constructor Detail |
---|
public LangProperties()
Method Detail |
---|
public void setDefaultLangPrefix(String langPrefix)
langPrefix
- an ISO-639 language code (without any '.')public String getLangProperty(String name, Object... formArgs)
name
- the property name to resolveformArgs
- an array of parameters to use to for the format of property
public String getExplicitLangProperty(LangProperty prop, String language)
prop
- the LangProperty
instance corresponding to the property you want to resolve.language
- the ISO-639 code language to use to retrieve this property
public String getExplicitLangProperty(String name, String language, Object[] formArgs)
Example :
String i18nStr = getExplicitLangProperty("ui.com.lbl.byte", "en", 6);
name
- the property name to resolvelanguage
- the language prefix used before the property name, usually an ISO-639
language code, if null, the default lang prefix is used.formArgs
- an array of parameters to use to for the format of property
public String[] getLangStringArrayProperty(String name, String[] defaultValue)
public JProperties getProperties(String prefix)
getProperties
in class JProperties
prefix
- the prefix the properties must match to be added to the
return LangProperties instance, if null, all properties are added.
public String format(String format, Object[] objects)
format
- the string containing the pattern to be replacedobjects
- an array of objects to be formatted and substituted.
public String format(String format, Object[] objects, String language)
format
- the string containing the pattern to be replacedobjects
- an array of objects to be formatted and substituted.language
- the language in which the string is being renderrd, used for recursive property such as "Hello {some.other.property}! "
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |