com.flexive.shared.value.renderer
Class FxValueRendererFactory

java.lang.Object
  extended by com.flexive.shared.value.renderer.FxValueRendererFactory

public class FxValueRendererFactory
extends java.lang.Object

Factory for FxValueRenderer. A FxValueRenderer provides a transparent way of formatting any FxValue object in a given language.

Version:
$Rev: 2919 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Field Summary
(package private) static FxLanguage DEFAULT
          Internal fallback default language for locale-agnostic formatters
 
Constructor Summary
FxValueRendererFactory()
           
 
Method Summary
static java.text.DateFormat getDateFormat()
          Get the date formatter for the current users locale
static java.text.DateFormat getDateFormat(java.util.Locale locale)
          Get the date formatter for the requested locale
static java.text.DateFormat getDateTimeFormat()
          Get the date/time formatter for the current users locale
static java.text.DateFormat getDateTimeFormat(java.util.Locale locale)
          Get the date/time formatter for the requested locale
static FxValueFormatter getDefaultFormatter(java.lang.Class valueType)
          Return the default FxValue formatter for the given FxValue subclass.
static FxValueRenderer getInstance()
          Return a FxValueRenderer instance for the user's current language.
static FxValueRenderer getInstance(FxLanguage language)
          Returns a FxValueRenderer instance for the given language.
static java.text.NumberFormat getNumberFormatInstance()
          Get a number format instance depending on the current users formatting options
static java.text.NumberFormat getNumberFormatInstance(java.util.Locale locale)
          Get a number format instance depending on the current users formatting options
static java.text.NumberFormat getPortableNumberFormatInstance()
          Get a portable number formatter instance
static java.text.DateFormat getTimeFormat()
          Get the time formatter for the current users locale
static java.text.DateFormat getTimeFormat(java.util.Locale locale)
          Get the time formatter for the requested locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

static final FxLanguage DEFAULT
Internal fallback default language for locale-agnostic formatters

Constructor Detail

FxValueRendererFactory

public FxValueRendererFactory()
Method Detail

getNumberFormatInstance

public static java.text.NumberFormat getNumberFormatInstance()
Get a number format instance depending on the current users formatting options

Returns:
NumberFormat
Since:
3.1.6

getPortableNumberFormatInstance

public static java.text.NumberFormat getPortableNumberFormatInstance()
Get a portable number formatter instance

Returns:
portable number formatter instance
Since:
3.1.6

getNumberFormatInstance

public static java.text.NumberFormat getNumberFormatInstance(java.util.Locale locale)
Get a number format instance depending on the current users formatting options

Parameters:
locale - locale to use
Returns:
NumberFormat
Since:
3.1.6

getDateFormat

public static java.text.DateFormat getDateFormat()
Get the date formatter for the current users locale

Returns:
DateFormat
Since:
3.1.6

getDateFormat

public static java.text.DateFormat getDateFormat(java.util.Locale locale)
Get the date formatter for the requested locale

Parameters:
locale - requested locale
Returns:
DateFormat
Since:
3.1.6

getTimeFormat

public static java.text.DateFormat getTimeFormat()
Get the time formatter for the current users locale

Returns:
DateFormat
Since:
3.1.6

getTimeFormat

public static java.text.DateFormat getTimeFormat(java.util.Locale locale)
Get the time formatter for the requested locale

Parameters:
locale - requested locale
Returns:
DateFormat
Since:
3.1.6

getDateTimeFormat

public static java.text.DateFormat getDateTimeFormat()
Get the date/time formatter for the current users locale

Returns:
DateFormat
Since:
3.1.6

getDateTimeFormat

public static java.text.DateFormat getDateTimeFormat(java.util.Locale locale)
Get the date/time formatter for the requested locale

Parameters:
locale - requested locale
Returns:
DateFormat
Since:
3.1.6

getInstance

public static FxValueRenderer getInstance()
Return a FxValueRenderer instance for the user's current language.

Returns:
a FxValueRenderer instance for the user's current language.

getInstance

public static FxValueRenderer getInstance(FxLanguage language)
Returns a FxValueRenderer instance for the given language. If language is null, the default renderer is returned.

Parameters:
language - the target language. Both the output formatting and the value to be rendered may depend on the renderer's language.
Returns:
a FxValueRenderer instance for the given language.

getDefaultFormatter

public static FxValueFormatter getDefaultFormatter(java.lang.Class valueType)
Return the default FxValue formatter for the given FxValue subclass.

Parameters:
valueType - class of the value to be formatted
Returns:
the default FxValue formatter for the given FxValue subclass.