VALUE
- is the generic type of the value to adapt. Typically a
TransferObject
or a
Datatype
.public interface UiDataBindingAdapter<VALUE>
UiDataBinding
. PojoPropertyAccessorBuilder
. However, we want to be
the minimum needed so users can replace reflective approaches with generated code or the like. Please note
that there is no reflection available in GWT context and therefore you will have limitations. If your
custom needs differ from what is offered out of the box, this is the place where to hook into.Modifier and Type | Method and Description |
---|---|
VALUE |
copy(VALUE value)
This method creates a copy (e.g.
|
VALUE |
createNewValue() |
<T> Class<T> |
getPropertyType(TypedProperty<T> property)
This method gets the
property type of the given
TypedProperty . |
<T> ValueValidator<T> |
getPropertyValidator(TypedProperty<T> property,
Class<T> propertyType)
This method gets or creates the
ValueValidator for the specified property. |
Object |
getPropertyValue(VALUE pojo,
String property)
This method gets the value of the specified property.
|
<T> T |
getPropertyValue(VALUE pojo,
TypedProperty<T> property)
This method gets the value of the specified property.
|
<T> Range<?> |
getRangeConstraints(TypedProperty<T> property,
Class<T> propertyType)
|
void |
setPropertyValue(VALUE pojo,
String property,
Object propertyValue)
This method sets the value of the specified property.
|
<T> void |
setPropertyValue(VALUE pojo,
TypedProperty<T> property,
T propertyValue)
This method sets the value of the specified property.
|
VALUE createNewValue()
VALUE copy(VALUE value)
clone
) of the given
value
. If the given value
is immutable (like String
, Long
,
etc.) it is legal to return the same given instance.value
- is the value to copy.<T> ValueValidator<T> getPropertyValidator(TypedProperty<T> property, Class<T> propertyType)
ValueValidator
for the specified property.T
- is the generic property type
.property
- is the TypedProperty
.propertyType
- is the Class
reflecting the property
type
.ValueValidator
for the given property.<T> Range<?> getRangeConstraints(TypedProperty<T> property, Class<T> propertyType)
Range
of the value for the specified property
in
the Pojo
associated with this adapter. It will consider JSR 303
annotations such as Min
, Max
,
DecimalMin
, and DecimalMax
.T
- is the generic type of the property.property
- is the TypedProperty
.propertyType
- is the Class
reflecting the property
type
.Range
or null
if unbound.<T> Class<T> getPropertyType(TypedProperty<T> property)
property type
of the given
TypedProperty
. This method might work even if TypedProperty.getPropertyType()
returns
null
.T
- is the generic property type
.property
- is the TypedProperty
.property type
of the given property
.<T> T getPropertyValue(VALUE pojo, TypedProperty<T> property)
T
- is the generic property type
.pojo
- is the Pojo
owning the property.property
- is the TypedProperty
.getPropertyValue(Object, String)
Object getPropertyValue(VALUE pojo, String property)
getPropertyValue(pojo, "foo")
is supposed to return pojo.getFoo()
.pojo
- is the Pojo
owning the property.property
- is the name of the requested property.<T> void setPropertyValue(VALUE pojo, TypedProperty<T> property, T propertyValue)
T
- is the generic property type
.pojo
- is the Pojo
owning the property.property
- is the TypedProperty
.propertyValue
- is the property value to set.setPropertyValue(Object, String, Object)
void setPropertyValue(VALUE pojo, String property, Object propertyValue)
setPropertyValue(pojo, "foo", value)
is supposed to do pojo.setFoo(value)
.pojo
- is the Pojo
owning the property.property
- is the name of the property to set.propertyValue
- is the property value to set.Copyright © 2001–2016 mmm-Team. All rights reserved.