|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.util.OwString
public class OwString
Utility class OwString. Used to localize strings.
NOTE: The class name OwString can be found by the FileNet Resourcecompiler.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Field Summary | |
---|---|
static String |
LABEL_PREFIX
prefix for labels |
protected String |
m_strDefaultDisplayName
default displayname if key was not found |
protected String |
m_strKeyName
key for localization |
Constructor Summary | |
---|---|
OwString(String strLabel_p)
construct a label (symbolic name or metadata) that can be localized later using getString(Locale locale_p) |
|
OwString(String strKeyyName_p,
String strDefaultDisplayName_p)
construct a string that can be localized later using getString(Locale locale_p) |
|
OwString(String strLabelOrKey_p,
String strDefaultDisplayName_p,
boolean fTreatAsLabel_p)
construct a string that can be localized later using getString(Locale locale_p) |
Method Summary | |
---|---|
String |
getDefaultDisplayName()
get the default displayname |
String |
getKey()
get the key |
String |
getString(Locale locale_p)
localize this String |
static boolean |
hasLabel(Locale local_p,
String strLabel_p)
check if a label (symbolic name or metadata) is defined |
static String |
localize(Locale local_p,
String strKey_p,
String strText_p)
localizes a string |
static String |
localize1(Locale local_p,
String strKey_p,
String strText_p,
String strAttribute1_p)
localizes a string with additional parameter that is replaced with %1 |
static String |
localize2(Locale local_p,
String strKey_p,
String strText_p,
String strAttribute1_p,
String strAttribute2_p)
localizes a string with additional parameter that is replaced with %1 |
static String |
localize3(Locale local_p,
String strKey_p,
String strText_p,
String strAttribute1_p,
String strAttribute2_p,
String strAttribute3_p)
localizes a string with additional parameter that is replaced with %1 |
static String |
localizeLabel(Locale local_p,
String strLabel_p)
localizes a label (symbolic name or metadata) |
static String |
localizeLabel(Locale local_p,
String strLabel_p,
String strDefault_p)
localizes a label (symbolic name or metadata) |
static void |
putAll(Locale locale_p,
Map properties_p)
Adds the given key mapped localization properties to the current text mappings. |
static void |
putLabel(Locale locale_p,
String key_p,
String label_p)
Adds the given key mapped label to the current text mappings. |
static void |
replaceAll(StringBuffer strIn_p,
String strPattern_p,
String strReplacement_p)
replaces all occurrences of strPattern_p with strReplacement_p |
static void |
replaceAll(StringBuilder strIn_p,
String pattern_p,
String replacement_p)
Replace all occurrences of the provided pattern with the replacement String. |
static String |
replaceAll(String strIn_p,
String strPattern_p,
String strReplacement_p)
replaces all occurrences of strPattern_p with strReplaceMent_p NOTE: This function might be replaced by String.replaceAll(...) function, which is provided in JDK 1.4. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String m_strKeyName
protected String m_strDefaultDisplayName
public static final String LABEL_PREFIX
Constructor Detail |
---|
public OwString(String strKeyyName_p, String strDefaultDisplayName_p)
strKeyyName_p
- String unique localize key for display namestrDefaultDisplayName_p
- String default display namepublic OwString(String strLabelOrKey_p, String strDefaultDisplayName_p, boolean fTreatAsLabel_p)
strLabelOrKey_p
- String (like a symbolic name) or a unique keystrDefaultDisplayName_p
- String default display namefTreatAsLabel_p
- boolean true = strLabelOrKey_p is a label, false = strLabelOrKey_p is a unique keypublic OwString(String strLabel_p)
strLabel_p
- String label (like a symbolic name)Method Detail |
---|
public String getKey()
public String getDefaultDisplayName()
public String toString()
toString
in class Object
public String getString(Locale locale_p)
locale_p
- Locale to use
public static void replaceAll(StringBuffer strIn_p, String strPattern_p, String strReplacement_p)
strIn_p
- StringBuffer to replacestrPattern_p
- String to look forstrReplacement_p
- replacement stringpublic static void replaceAll(StringBuilder strIn_p, String pattern_p, String replacement_p)
strIn_p
- StringBuilderpattern_p
- String pattern to replacereplacement_p
- String replacement for patternpublic static String replaceAll(String strIn_p, String strPattern_p, String strReplacement_p)
strIn_p
- String to replacestrPattern_p
- String to look forstrReplacement_p
- replacement string
public static String localizeLabel(Locale local_p, String strLabel_p)
local_p
- Locale to usestrLabel_p
- label that should be localized
public static boolean hasLabel(Locale local_p, String strLabel_p)
local_p
- Locale to usestrLabel_p
- label that should be localized
public static String localize(Locale local_p, String strKey_p, String strText_p)
local_p
- Locale to usestrKey_p
- Key value used to retrieve localized string from resourcestrText_p
- current language Text
public static String localizeLabel(Locale local_p, String strLabel_p, String strDefault_p)
local_p
- Locale to usestrLabel_p
- label that should be localizedstrDefault_p
- default if label does not exist
public static String localize1(Locale local_p, String strKey_p, String strText_p, String strAttribute1_p)
local_p
- Locale to usestrKey_p
- Key value used to retrieve localized string from resourcestrText_p
- current language TextstrAttribute1_p
- String that replaces %1 tokens
public static String localize2(Locale local_p, String strKey_p, String strText_p, String strAttribute1_p, String strAttribute2_p)
local_p
- Locale to usestrKey_p
- Key value used to retrieve localized string from resourcestrText_p
- current language TextstrAttribute1_p
- String that replaces %1 tokensstrAttribute2_p
- String that replaces %2 tokens
public static String localize3(Locale local_p, String strKey_p, String strText_p, String strAttribute1_p, String strAttribute2_p, String strAttribute3_p)
local_p
- Locale to usestrKey_p
- Key value used to retrieve localized string from resourcestrText_p
- current language TextstrAttribute1_p
- String that replaces %1 tokensstrAttribute2_p
- String that replaces %2 tokensstrAttribute3_p
- String that replaces %3 tokens
public static void putAll(Locale locale_p, Map properties_p) throws Exception
locale_p
- properties_p
-
Exception
public static void putLabel(Locale locale_p, String key_p, String label_p) throws Exception
LABEL_PREFIX
is added to the given key.
locale_p
- key_p
- label_p
-
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |