Interface IComponentValueConverter<ExternalValue,ComponentValue>
-
- Type Parameters:
ExternalValue
- Type of the external value, usually the value used by the backing bean.ComponentValue
- Type of the value required by the JSF or PF component.
- All Known Implementing Classes:
DurationPartsConverter
,TypePartsConverter
public interface IComponentValueConverter<ExternalValue,ComponentValue>
Used with the composite componentconvertible
. Lets you convert between a bean value and the value that is used for the component or components. For example, you could have a bean propertydate
, of typeDate
. If you want to have three different input fields, one for the year, one for the month, and one for the day, you can use the convertible composite component. This way you do not have to add new bean properties for the year, month, and date, which would require you to keep them in sync with the original date object. SeeConvertibleComponent
for an example.- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ExternalValue
componentToExternalValue(IConvertibleMap<ComponentValue> componentValues)
default IConvertibleMap<ComponentValue>
createOptions(IConvertibleMap<ComponentValue> componentValues)
IConvertibleMap<ComponentValue>
externalToComponentValue(ExternalValue value)
default IConvertibleMap<ComponentValue>
newConvertibleMap()
-
-
-
Method Detail
-
externalToComponentValue
IConvertibleMap<ComponentValue> externalToComponentValue(ExternalValue value)
- Parameters:
value
- The value on the backing bean or the model.- Returns:
- A map of values to be used on the component. In your xhtml, you can use the key you assign here to access the value.
-
componentToExternalValue
ExternalValue componentToExternalValue(IConvertibleMap<ComponentValue> componentValues)
- Parameters:
componentValues
- The value on the component.- Returns:
- The value to be set on the backing bean or model.
-
createOptions
default IConvertibleMap<ComponentValue> createOptions(IConvertibleMap<ComponentValue> componentValues)
- Parameters:
componentValues
- The values as used for the component.- Returns:
- An optional map of additional options for the component.
-
newConvertibleMap
default IConvertibleMap<ComponentValue> newConvertibleMap()
- Returns:
- A new, empty convertible map. Used as the default when none is avaiable yet.
-
-