Class LocalizedResource
java.lang.Object
org.apache.derby.iapi.tools.i18n.LocalizedResource
- All Implemented Interfaces:
PrivilegedAction<String>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate booleanprivate Stringstatic final Stringstatic final Stringprivate DateFormatprivate DecimalFormatprivate NumberFormatprivate DateFormatprivate DateFormatprivate LocalizedInputprivate static LocalizedResourceprivate Localeprivate static final Stringprivate Stringprivate LocalizedOutputprivate ResourceBundleprivate Stringprivate intprivate int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLocalizedResource(String msgF) LocalizedResource(String encStr, String locStr, String msgF) This overload version does not check the environment for values of encoding viaENV_CODESETand locale viaENV_LOCALE. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanenableLocalization(boolean mode) intgetColumnDisplaySize(ResultSetMetaData rsm, int columnNumber) private final StringgetEnvProperty(String key) static LocalizedResourcegetLocalizedString(ResultSet rs, ResultSetMetaData rsm, int columnNumber) static StringgetMessage(String key, Object... args) getNewEncodedInput(InputStream i, String encoding) getNewEncodedOutput(OutputStream o, String encoding) Get a new LocalizedOutput with the given encoding.private LocalegetNewLocale(String locStr) static StringgetNumber(int o) static StringgetNumber(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) voidinit()voidprivate voidprivate voidstatic LocalizedInputbooleanstatic LocalizedOutputstatic voidfinal Stringrun()private voidtoString()
-
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_CODESETand 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:
runin interfacePrivilegedAction<String>
-
enableLocalization
public static boolean enableLocalization(boolean mode) -
isLocalized
public boolean isLocalized() -
getMessage
-
OutputWriter
-
InputReader
-
getNumber
-
getNumber
-
toString
-