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

Variable Index

 o PERFORM_LOCALIZATION
variables representing constants
 o debug

Method Index

 o changeStyleOfDate(int)
Helper method to switch between different styles of dates, times and time stamps.
 o formatNumber(String)
 o formatValue(Object)
Method to return localized formatted string.
 o getDateFromString(String, int)
 o getLocalizationStatus()
 o getNumberFromString(String, int)
 o getScaleForNumber(Number)
 o initializeStyleVector()
Helper method to initialize the vector of styles with DateFormat.DEFAULT, FULL, LONG, MEDIUM, SHORT.
 o isNumber(String)
 o isObjOfDateType(Object)
 o isObjOfNumberType(Object)
 o isObjToBeLocalized(Object)
Method to determine if localization needs to be performed for this object
 o isScientificNotation(String)
 o parseDateValue(String, int)
Method to return localized date value.
 o parseDateValue(String, int, int)
 o parseNumberValue(String, int)
Method to return localized number value.
 o prepareNewValueForComparision(String)
 o prepareOldValueForComparision(String, boolean, boolean)
 o stripGroupingSep(String)

Variables

 o PERFORM_LOCALIZATION
public static final boolean PERFORM_LOCALIZATION
variables representing constants

 o debug
public static final boolean debug

Methods

 o 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.
 o formatNumber
public static java.lang.String formatNumber(String param)
 o 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
 o getDateFromString
protected static synchronized java.util.Date getDateFromString(String objSwitch,
                                                               int toDataType)
 o getLocalizationStatus
public static synchronized boolean getLocalizationStatus()
 o getNumberFromString
protected static synchronized java.lang.Number getNumberFromString(String objSwitch,
                                                                   int toDataType)
 o getScaleForNumber
protected static synchronized int getScaleForNumber(Number num)
 o initializeStyleVector
protected static synchronized void initializeStyleVector()
Helper method to initialize the vector of styles with DateFormat.DEFAULT, FULL, LONG, MEDIUM, SHORT.

 o isNumber
protected static synchronized boolean isNumber(String numStr)
 o isObjOfDateType
protected static synchronized boolean isObjOfDateType(Object inputVal)
 o isObjOfNumberType
protected static synchronized boolean isObjOfNumberType(Object inputVal)
 o 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
 o isScientificNotation
protected static synchronized boolean isScientificNotation(String numStr)
 o 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
 o parseDateValue
protected static synchronized java.util.Date parseDateValue(String value,
                                                            int toDataType,
                                                            int style) throws ParseException
 o 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
 o prepareNewValueForComparision
protected static synchronized java.lang.String prepareNewValueForComparision(String value)
 o prepareOldValueForComparision
protected static synchronized java.lang.String prepareOldValueForComparision(String value,
                                                                             boolean stripLeading,
                                                                             boolean stripTrailing)
 o stripGroupingSep
protected static synchronized java.lang.String stripGroupingSep(String value)

All Packages  Class Hierarchy  This Package  Previous  Next  Index