Class DefaultBindableElement
java.lang.Object
org.tentackle.bind.DefaultBindableElement
- All Implemented Interfaces:
BindableElement
A bindable element.
Bindable elements are annotated by the @Bindable-annotation.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBindingOptions(String options) Adds binding options.Gets the binding options.Gets the camelcase name of this element.getField()Gets the bound field.getFrom()Gets the "from"-method.
Members of immutable objects may provide a from method that takes the new member value as its argument and returns a new immutable object that will be set as the parent member's value.Gets the generic type of the member.Gets the getter method.Gets the object of this element.intGets the ordinal for sorting.Gets the setter method.Class<?> getType()Gets the type of the member.booleanReturns whether element is read only.voidsetBindingOptions(String options) Sets the binding options.voidsetCamelName(String camelName) Sets the camelcase name of this element.voidSets the bound field.voidSets the "from"-method.voidSets the getter method.Sets the object of this member.
The method does nothing if the element is readonly.voidsetOrdinal(int ordinal) Sets the ordinal for sorting.voidSets the setter method.
-
Constructor Details
-
DefaultBindableElement
Creates a bindable element.- Parameters:
camelName- the member name in camelCase
-
-
Method Details
-
getCamelName
Description copied from interface:BindableElementGets the camelcase name of this element.- Specified by:
getCamelNamein interfaceBindableElement- Returns:
- the camelcase name
-
setCamelName
Description copied from interface:BindableElementSets the camelcase name of this element.- Specified by:
setCamelNamein interfaceBindableElement- Parameters:
camelName- the name in camelcase
-
getOrdinal
public int getOrdinal()Description copied from interface:BindableElementGets the ordinal for sorting.- Specified by:
getOrdinalin interfaceBindableElement- Returns:
- the ordinal, defaults to 0
-
setOrdinal
public void setOrdinal(int ordinal) Description copied from interface:BindableElementSets the ordinal for sorting.- Specified by:
setOrdinalin interfaceBindableElement- Parameters:
ordinal- the ordinal
-
getBindingOptions
Description copied from interface:BindableElementGets the binding options.- Specified by:
getBindingOptionsin interfaceBindableElement- Returns:
- the binding options, null or empty if none
-
setBindingOptions
Description copied from interface:BindableElementSets the binding options.- Specified by:
setBindingOptionsin interfaceBindableElement- Parameters:
options- the options (separated by commas)
-
addBindingOptions
Description copied from interface:BindableElementAdds binding options.- Specified by:
addBindingOptionsin interfaceBindableElement- Parameters:
options- the options to add- See Also:
-
getField
Description copied from interface:BindableElementGets the bound field.- Specified by:
getFieldin interfaceBindableElement- Returns:
- the field, null if none
-
setField
Description copied from interface:BindableElementSets the bound field.- Specified by:
setFieldin interfaceBindableElement- Parameters:
field- the field, null to clear
-
getGetter
Description copied from interface:BindableElementGets the getter method.- Specified by:
getGetterin interfaceBindableElement- Returns:
- the method, null if none
-
setGetter
Description copied from interface:BindableElementSets the getter method.- Specified by:
setGetterin interfaceBindableElement- Parameters:
getter- the getter method, null to clear
-
getSetter
Description copied from interface:BindableElementGets the setter method.- Specified by:
getSetterin interfaceBindableElement- Returns:
- the setter method, null if none
-
setSetter
Description copied from interface:BindableElementSets the setter method.- Specified by:
setSetterin interfaceBindableElement- Parameters:
setter- the setter, null to clear
-
getFrom
Description copied from interface:BindableElementGets the "from"-method.
Members of immutable objects may provide a from method that takes the new member value as its argument and returns a new immutable object that will be set as the parent member's value.- Specified by:
getFromin interfaceBindableElement- Returns:
- the "from"-method, null if none
-
setFrom
Description copied from interface:BindableElementSets the "from"-method.- Specified by:
setFromin interfaceBindableElement- Parameters:
from- the "from"-method, null to clear
-
getObject
Description copied from interface:BindableElementGets the object of this element.- Specified by:
getObjectin interfaceBindableElement- Parameters:
parent- the parent containing this element- Returns:
- the object of this member
-
setObject
Description copied from interface:BindableElementSets the object of this member.
The method does nothing if the element is readonly.- Specified by:
setObjectin interfaceBindableElement- Parameters:
parent- the parent containing this membervalue- the object to set- Returns:
- the new parent if value was updated via "from"- or "with"-method
-
isReadOnly
public boolean isReadOnly()Description copied from interface:BindableElementReturns whether element is read only.- Specified by:
isReadOnlyin interfaceBindableElement- Returns:
- true if not a field and no setter or from method
-
getType
Description copied from interface:BindableElementGets the type of the member.- Specified by:
getTypein interfaceBindableElement- Returns:
- the class
-
getGenericType
Description copied from interface:BindableElementGets the generic type of the member.- Specified by:
getGenericTypein interfaceBindableElement- Returns:
- the generic type
-