Oracle Data-aware Controls Reference

oracle.dacf.formatter
Class DefaultFormatManager

java.lang.Object
  extended byoracle.dacf.formatter.DefaultFormatManager
All Implemented Interfaces:
FormatManager

public class DefaultFormatManager
extends java.lang.Object
implements FormatManager

This class manages a set of data formatter's.


Field Summary
static java.lang.Object CURRENCY_VALUE
          format currency values
static java.lang.Object DATE_VALUE
          format Date values
static java.lang.Object MESSAGE_FORMATTER
          generic formatter
static java.lang.Object NUMERIC_VALUE
          format numeric values
static java.lang.Object PERCENTAGE_VALUE
          format percentage values
 
Method Summary
 java.lang.Object addFormatter(java.lang.String formatterPathName)
          adds a Formatter object to the list of formatter's maintained.
 Formatter getFormatter(java.lang.Class forThisClassType)
          retrieve a Formatter by class type
 Formatter getFormatter(java.lang.Object key)
          retrieve a Formatter by key name.
 java.lang.Object getFormatterKey(Formatter theFormatter)
          get Key used for a particular Formatter
static DefaultFormatManager getInstance()
          DefaultFormatManager is implemented as a singleton and cannot be instantiated directly.
static DefaultFormatManager getInstance(java.util.Locale thisLocale)
          return an instance of Formatter to format data in a locale specific manner
 java.util.Locale getLocale()
          get Locale currently in use
 void removeAllFormatters()
          remove all Formatter objects maintained by this manager
 void removeFormatter(java.lang.Object key)
          remove a Formatter object.
 void replaceFormatter(java.lang.Object forThisKey, Formatter withThisFormatter)
          replace a Formatter.
 void setLocale(java.util.Locale thisLocale)
          define locale to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_VALUE

public static final java.lang.Object DATE_VALUE
format Date values


NUMERIC_VALUE

public static final java.lang.Object NUMERIC_VALUE
format numeric values


CURRENCY_VALUE

public static final java.lang.Object CURRENCY_VALUE
format currency values


PERCENTAGE_VALUE

public static final java.lang.Object PERCENTAGE_VALUE
format percentage values


MESSAGE_FORMATTER

public static final java.lang.Object MESSAGE_FORMATTER
generic formatter

Method Detail

getInstance

public static DefaultFormatManager getInstance()
DefaultFormatManager is implemented as a singleton and cannot be instantiated directly. Clients must use getInstance() method to get an instance.

Returns:
DefaultFormatManager object

getInstance

public static DefaultFormatManager getInstance(java.util.Locale thisLocale)
return an instance of Formatter to format data in a locale specific manner

Returns:
DefaultFormatManager object for specified locale

setLocale

public void setLocale(java.util.Locale thisLocale)
               throws UnknownLocaleException
define locale to be used. Format manager will propogate the request to all Formatters

Specified by:
setLocale in interface FormatManager
Parameters:
thisLocale - locale to be used
Throws:
UnknownLocaleException - if the formatter does'nt support the specified Locale.

getLocale

public java.util.Locale getLocale()
get Locale currently in use

Specified by:
getLocale in interface FormatManager

getFormatter

public Formatter getFormatter(java.lang.Object key)
                       throws UnknownFormatterException
retrieve a Formatter by key name.

Specified by:
getFormatter in interface FormatManager
Parameters:
key - This could be one of the following values or value returned by an earlier addFormatter call
Returns:
Formatter object requested for
Throws:
UnknownFormatterException - when requested Formatter object not found.

getFormatter

public Formatter getFormatter(java.lang.Class forThisClassType)
                       throws UnknownFormatterException
retrieve a Formatter by class type

Specified by:
getFormatter in interface FormatManager
Parameters:
forThisClassType - retrieve a formatter object to format data of this class type.
Returns:
Formatter object requested for
Throws:
UnknownFormatterException - when requested Formatter object not found.

addFormatter

public java.lang.Object addFormatter(java.lang.String formatterPathName)
                              throws java.lang.IllegalArgumentException
adds a Formatter object to the list of formatter's maintained.

Specified by:
addFormatter in interface FormatManager
Parameters:
formatterPathName - fully qualified path name of the formatter class.
Returns:
Object which serves as a key for the Formatter object just added.
Throws:
java.lang.IllegalArgumentException - when unable to dynamically load a class identified by 'formatterPathName'.

removeFormatter

public void removeFormatter(java.lang.Object key)
                     throws java.lang.IllegalArgumentException
remove a Formatter object.

Specified by:
removeFormatter in interface FormatManager
Parameters:
key - identify which object to remove
Throws:
java.lang.IllegalArgumentException - when unable to dynamically load a class identified by 'formatterPathName'.

removeAllFormatters

public void removeAllFormatters()
remove all Formatter objects maintained by this manager

Specified by:
removeAllFormatters in interface FormatManager
Returns:
none

replaceFormatter

public void replaceFormatter(java.lang.Object forThisKey,
                             Formatter withThisFormatter)
                      throws java.lang.IllegalArgumentException
replace a Formatter.

Specified by:
replaceFormatter in interface FormatManager
Parameters:
forThisKey - value returned by addFormatter
withThisFormatter - new Formatter to use
Throws:
java.lang.IllegalArgumentException

getFormatterKey

public java.lang.Object getFormatterKey(Formatter theFormatter)
get Key used for a particular Formatter

Returns:
key used for the Formatter

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.