Package org.apache.derby.iapi.tools.i18n
Class LocalizedResource
java.lang.Object
org.apache.derby.iapi.tools.i18n.LocalizedResource
- All Implemented Interfaces:
PrivilegedAction<String>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private boolean
private String
static final String
static final String
private DateFormat
private DecimalFormat
private NumberFormat
private DateFormat
private DateFormat
private LocalizedInput
private static LocalizedResource
private Locale
private static final String
private String
private LocalizedOutput
private ResourceBundle
private String
private int
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
LocalizedResource
(String msgF) LocalizedResource
(String encStr, String locStr, String msgF) This overload version does not check the environment for values of encoding viaENV_CODESET
and locale viaENV_LOCALE
. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
enableLocalization
(boolean mode) int
getColumnDisplaySize
(ResultSetMetaData rsm, int columnNumber) private final String
getEnvProperty
(String key) static LocalizedResource
getLocalizedString
(ResultSet rs, ResultSetMetaData rsm, int columnNumber) static String
getMessage
(String key, Object... args) getNewEncodedInput
(InputStream i, String encoding) getNewEncodedOutput
(OutputStream o, String encoding) Get a new LocalizedOutput with the given encoding.private Locale
getNewLocale
(String locStr) static String
getNumber
(int o) static String
getNumber
(long o) getNumberAsString
(double o) getNumberAsString
(int o) getNumberAsString
(long o) getStringFromDate
(String dateStr) getStringFromTime
(String timeStr) getStringFromTimestamp
(String timestampStr) getStringFromValue
(String val) getTextMessage
(String key, Object... objectArr) void
init()
void
private void
private void
static LocalizedInput
boolean
static LocalizedOutput
static void
final String
run()
private void
toString()
-
Field Details
-
res
-
locale
-
encode
-
MESSAGE_FILE
- See Also:
-
ENV_CODESET
- See Also:
-
ENV_LOCALE
- See Also:
-
messageFileName
-
resourceKey
-
out
-
in
-
enableLocalized
private boolean enableLocalized -
local
-
dateSize
private int dateSize -
timeSize
private int timeSize -
timestampSize
private int timestampSize -
formatDate
-
formatTime
-
formatTimestamp
-
formatNumber
-
formatDecimal
-
-
Constructor Details
-
LocalizedResource
private LocalizedResource() -
LocalizedResource
-
LocalizedResource
This overload version does not check the environment for values of encoding viaENV_CODESET
and locale viaENV_LOCALE
. The others do if value of either is null. DERBY-6680.- Parameters:
encStr
- encodinglocStr
- localemsgF
- message file
-
-
Method Details
-
getInstance
-
resetLocalizedResourceCache
public static void resetLocalizedResourceCache() -
init
public void init() -
init
-
init
-
setResource
private void setResource() -
initMaxSizes2
private void initMaxSizes2() -
getNewInput
-
getNewEncodedInput
-
getNewOutput
-
getNewEncodedOutput
public LocalizedOutput getNewEncodedOutput(OutputStream o, String encoding) throws UnsupportedEncodingException Get a new LocalizedOutput with the given encoding.- Throws:
UnsupportedEncodingException
-
getNewLocale
-
getTextMessage
-
getLocalizedString
public String getLocalizedString(ResultSet rs, ResultSetMetaData rsm, int columnNumber) throws SQLException - Throws:
SQLException
-
getDateAsString
-
getTimeAsString
-
getNumberAsString
-
getNumberAsString
-
getNumberAsString
-
getNumberAsString
-
getTimestampAsString
-
getColumnDisplaySize
- Throws:
SQLException
-
getStringFromDate
- Throws:
ParseException
-
getStringFromTime
- Throws:
ParseException
-
getStringFromValue
- Throws:
ParseException
-
getStringFromTimestamp
- Throws:
ParseException
-
getLocale
-
getEnvProperty
-
run
- Specified by:
run
in interfacePrivilegedAction<String>
-
enableLocalization
public static boolean enableLocalization(boolean mode) -
isLocalized
public boolean isLocalized() -
getMessage
-
OutputWriter
-
InputReader
-
getNumber
-
getNumber
-
toString
-