com.flexive.shared.value.renderer
Interface FxValueRenderer

All Known Implementing Classes:
FxValueRendererImpl

public interface FxValueRenderer

A locale-specific renderer for FxValue objects.

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

Method Summary
 java.lang.String format(FxValue value)
          Formats the given value in the renderer's locale.
 java.lang.String format(FxValue value, FxLanguage translationLanguage)
          Formats the given value in the renderer's locale.
 FxValueRenderer render(java.io.Writer out, FxValue value)
          Renders the given value in the renderer's locale to the output writer.
 FxValueRenderer render(java.io.Writer out, FxValue value, FxLanguage translationLanguage)
          Renders the given value in the renderer's locale to the output writer.
 

Method Detail

format

java.lang.String format(FxValue value)
Formats the given value in the renderer's locale. If value is multi-lingual, then the translation in the renderer's locale is used. If no translation is available, the default translation is used (see FxValue.getBestTranslation() }).

Parameters:
value - the value to be formatted
Returns:
the formatted value

format

java.lang.String format(FxValue value,
                        FxLanguage translationLanguage)
Formats the given value in the renderer's locale. If value is multi-lingual, then the translation for the given translationLanguage is used. If no translation is available, the default translation is used (see FxValue.getBestTranslation() }).

Parameters:
value - the value to be formatted
translationLanguage - the translation which should be retrieved from the value
Returns:
the formatted value

render

FxValueRenderer render(java.io.Writer out,
                       FxValue value)
                       throws java.io.IOException
Renders the given value in the renderer's locale to the output writer. If value is multi-lingual, then the translation in the renderer's locale is used. If no translation is available, the default translation is used (see FxValue.getBestTranslation() }).

Parameters:
out - the output writer
value - the value to be rendered
Returns:
the FxValueRenderer instance
Throws:
java.io.IOException - if the value could not be written

render

FxValueRenderer render(java.io.Writer out,
                       FxValue value,
                       FxLanguage translationLanguage)
                       throws java.io.IOException
Renders the given value in the renderer's locale to the output writer. If value is multi-lingual, then the translation for the given translationLanguage is used. If no translation is available, the default translation is used (see FxValue.getBestTranslation() }).

Parameters:
out - the output writer
value - the value to be rendered
translationLanguage - the translation which should be retrieved from the value
Returns:
the FxValueRenderer instance
Throws:
java.io.IOException - if the value could not be written