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: 662 $
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 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.
 
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

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.