SOURCE
- the type of the input item, from which the number is extractedpublic class NumberRenderer<SOURCE> extends BasicRenderer<SOURCE,Number>
Modifier | Constructor and Description |
---|---|
protected |
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
Locale locale)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
NumberFormat numberFormat)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
NumberFormat numberFormat,
String nullRepresentation)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
String formatString)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
String formatString,
Locale locale)
Creates a new number renderer.
|
|
NumberRenderer(ValueProvider<SOURCE,Number> valueProvider,
String formatString,
Locale locale,
String nullRepresentation)
Creates a new number renderer.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getFormattedValue(Number value)
Gets the String representation of the target object, to be used inside
the template.
|
createComponent, getTemplateForProperty, getTemplatePropertyName, getValueProvider, render
setComponentRendererTag, updateComponent
getEventHandlers, getValueProviders, render, setEventHandler, setProperty
protected NumberRenderer(ValueProvider<SOURCE,Number> valueProvider)
The renderer is configured to render with the number's natural string representation in the default locale.
valueProvider
- the callback to provide a Number
to the renderer, not
null
public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, NumberFormat numberFormat)
The renderer is configured to render the number as defined with the given number format.
valueProvider
- the callback to provide a Number
to the renderer, not
null
numberFormat
- the number format with which to display numbers, not
null
public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, NumberFormat numberFormat, String nullRepresentation)
The renderer is configured to render the number as defined with the given number format.
valueProvider
- the callback to provide a Number
to the renderer, not
null
numberFormat
- the number format with which to display numbers, not
null
nullRepresentation
- the textual representation of null
valuepublic NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, Locale locale)
The renderer is configured to render with the number's natural string representation in the given locale.
valueProvider
- the callback to provide a Number
to the renderer, not
null
locale
- the locale in which to display numberspublic NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString, Locale locale)
The renderer is configured to render with the number's natural string representation in the given locale.
valueProvider
- the callback to provide a Number
to the renderer, not
null
formatString
- the format string with which to format the number, not
null
locale
- the locale in which to display numbers, not null
public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString)
The renderer is configured to render with the given format string in the default locale.
valueProvider
- the callback to provide a Number
to the renderer, not
null
formatString
- the format string with which to format the number, not
null
public NumberRenderer(ValueProvider<SOURCE,Number> valueProvider, String formatString, Locale locale, String nullRepresentation)
The renderer is configured to render with the given format string in the given locale.
valueProvider
- the callback to provide a Number
to the renderer, not
null
formatString
- the format string with which to format the number, not
null
locale
- the locale in which to present numbers, not null
nullRepresentation
- the textual representation of null
valueprotected String getFormattedValue(Number value)
BasicRenderer
By default it uses String.valueOf(Object)
of the object.
getFormattedValue
in class BasicRenderer<SOURCE,Number>
value
- the target objectCopyright © 2023. All rights reserved.