|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unitesk.atp.text.localize.ConstantStringManager
com.unitesk.atp.text.localize.PatternStringManager
public class PatternStringManager
This string manager
treats localized strings as
patterns
.
Pattern parameters are printed using the same resource name.
If resource not found Object.toString()
is used.
Field Summary |
---|
Fields inherited from class com.unitesk.atp.text.localize.ConstantStringManager |
---|
class_to_bundle, classLoader, locale |
Constructor Summary | |
---|---|
PatternStringManager()
Creates new localized strings manager using default locale and class loader of this class. |
|
PatternStringManager(Locale locale)
Creates new localized strings manager using the specified locale and class loader of this class. |
|
PatternStringManager(Locale locale,
ClassLoader classLoader)
Creates new localized strings manager with the specified locale and class loader. |
Method Summary | |
---|---|
String |
getPattern(Class cls,
String name)
|
String |
getPattern(String name,
Object obj)
|
String |
getString(Class cls,
String name,
Object obj)
Get localized string for the specified class and object. |
String |
getString(String name,
Object obj)
Get localized string for the specified object. |
protected void |
setResource(String resource)
|
protected void |
setResourceClass(Class resourceClass)
|
protected String |
substitute(String pattern,
Object obj)
|
Methods inherited from class com.unitesk.atp.text.localize.ConstantStringManager |
---|
getBundle, getString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatternStringManager()
public PatternStringManager(Locale locale)
locale
- The locale to be used by this manager.public PatternStringManager(Locale locale, ClassLoader classLoader)
locale
- The locale to be used by this manager.classLoader
- The class loader to be used by this maanger.Method Detail |
---|
public String getString(Class cls, String name, Object obj)
This method calls super implementation
, treats returned value as
pattern
and substitute
its parameters by attributes of the specified object.
getString
in interface StringManager
getString
in class ConstantStringManager
cls
- The specified class.name
- The name of localized string for this class.obj
- The specified object.
public String getString(String name, Object obj)
This method calls super implementation
, treats returned value as
pattern
and substitute
its parameters by attributes of the specified object.
getString
in interface StringManager
getString
in class ConstantStringManager
name
- The name of localized string for this object.obj
- The specified object.
null
if it is not found.public String getPattern(String name, Object obj)
public String getPattern(Class cls, String name)
protected String substitute(String pattern, Object obj)
protected void setResource(String resource)
protected void setResourceClass(Class resourceClass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |