Class symantec.itools.db.beans.util.LocalizedValueGenerator
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.db.beans.util.LocalizedValueGenerator
Object
|
+----symantec.itools.db.beans.util.LocalizedValueGenerator
- public class LocalizedValueGenerator
- extends Object
Class to return localized values depending on the object type.
This logic is to be used by Mediators, BindingModel, TableBindingModel
etc. So the entire logic has been moved to this class for reuse
- Version:
- 1.0 10/27/98
- Author:
- Puru Balakrishnan
-
PERFORM_LOCALIZATION
- variables representing constants
-
debug
-
-
changeStyleOfDate(int)
- Helper method to switch between different styles of dates, times and time stamps.
-
formatNumber(String)
-
-
formatValue(Object)
- Method to return localized formatted string.
-
getDateFromString(String, int)
-
-
getLocalizationStatus()
-
-
getNumberFromString(String, int)
-
-
getScaleForNumber(Number)
-
-
initializeStyleVector()
- Helper method to initialize the vector of styles with DateFormat.DEFAULT,
FULL, LONG, MEDIUM, SHORT.
-
isNumber(String)
-
-
isObjOfDateType(Object)
-
-
isObjOfNumberType(Object)
-
-
isObjToBeLocalized(Object)
- Method to determine if localization needs to be performed for this object
-
isScientificNotation(String)
-
-
parseDateValue(String, int)
- Method to return localized date value.
-
parseDateValue(String, int, int)
-
-
parseNumberValue(String, int)
- Method to return localized number value.
-
prepareNewValueForComparision(String)
-
-
prepareOldValueForComparision(String, boolean, boolean)
-
-
stripGroupingSep(String)
-
PERFORM_LOCALIZATION
public static final boolean PERFORM_LOCALIZATION
- variables representing constants
debug
public static final boolean debug
changeStyleOfDate
protected static synchronized void changeStyleOfDate(int val)
- Helper method to switch between different styles of dates, times and time stamps.
- Parameters:
- val - value can be one of DateFormat.DEFAULT, FULL, LONG, SHORT, MEDIUM.
formatNumber
public static java.lang.String formatNumber(String param)
formatValue
public static synchronized java.lang.Object formatValue(Object inputVal)
- Method to return localized formatted string.
Note: This method is called from Mediator or BindingModel where
there is no knowledge about the data type. The localization is
to be done depending upon the type of Java Object.
- Parameters:
- inputVal - the Object value to be localized
- groupingUsed -
true
if grouping should be used
false
otherwise
- Returns:
- localized object value
getDateFromString
protected static synchronized java.util.Date getDateFromString(String objSwitch,
int toDataType)
getLocalizationStatus
public static synchronized boolean getLocalizationStatus()
getNumberFromString
protected static synchronized java.lang.Number getNumberFromString(String objSwitch,
int toDataType)
getScaleForNumber
protected static synchronized int getScaleForNumber(Number num)
initializeStyleVector
protected static synchronized void initializeStyleVector()
- Helper method to initialize the vector of styles with DateFormat.DEFAULT,
FULL, LONG, MEDIUM, SHORT.
isNumber
protected static synchronized boolean isNumber(String numStr)
isObjOfDateType
protected static synchronized boolean isObjOfDateType(Object inputVal)
isObjOfNumberType
protected static synchronized boolean isObjOfNumberType(Object inputVal)
isObjToBeLocalized
public static synchronized boolean isObjToBeLocalized(Object objVal)
- Method to determine if localization needs to be performed for this object
- Parameters:
- Object - value to be localized
- Returns:
- boolean indicating true or false
isScientificNotation
protected static synchronized boolean isScientificNotation(String numStr)
parseDateValue
public static synchronized java.util.Date parseDateValue(String value,
int toDataType) throws ParseException
- Method to return localized date value.
Note: This method is called from BaseRecordDefinition where
the data type is known.
- Parameters:
- Object - value to be localized
- Returns:
- localized object value
- Throws: ParseException
-
parseDateValue
protected static synchronized java.util.Date parseDateValue(String value,
int toDataType,
int style) throws ParseException
parseNumberValue
public static synchronized java.lang.Number parseNumberValue(String param,
int toDataType) throws ParseException
- Method to return localized number value.
Note: This method is called from BaseRecordDefinition where
the data type is known.
- Parameters:
- Object - value to be localized
- Returns:
- localized object value
- Throws: ParseException
-
prepareNewValueForComparision
protected static synchronized java.lang.String prepareNewValueForComparision(String value)
prepareOldValueForComparision
protected static synchronized java.lang.String prepareOldValueForComparision(String value,
boolean stripLeading,
boolean stripTrailing)
stripGroupingSep
protected static synchronized java.lang.String stripGroupingSep(String value)
All Packages Class Hierarchy This Package Previous Next Index