Define DataBinding objects
A DataBinding. is the abstraction of an evaluable expression which might be executed in a BindingEvaluationContext.
A DataBinding is defined in the context of a Bindable., which is the owner of DataBinding
(remember that Bindable
references both a BindingFactory
and a BindingModel
)
A DataBinding might be created using this constructor:
public DataBinding(String unparsed, Bindable owner, Type declaredType, BindingDefinitionType bdType);
For example:
Bindable myBindable = ...; // myBindable should be somewhere initialized
DataBinding<String> myBinding = new DataBinding<String>("person.name",myBindable,String.class,BindingDefinitionType.GET_SET);
Initialize a DataBinding
:
whose owner is the
myBindable
variable (aBindable
instance)where declared type (type of expression defined by the binding) is
String
where binding is executable both as readable and settable
where expression is set to
person.name
To be valid,
myBindable
variable should define:a
BindingModel
declaring aBindingVariable
called'person'
(suppose that type of this variable is reflected byPerson
Java class)a suitable
BindingFactory
allowing to browse'name'
from aPerson
type (this might be implemented byPerson
Java class if this class defines bothgetName()
andsetName(String)
methods, and ifJavaBindingFactory
is used)Validity of a
DataBinding
might be tested usingisValid()
method.
Reference documentation
(overview) Introduction to CONNIE
(advanced) Defining a binding strategy
(programmer) Defining bindable context
(user) Defining DataBinding objects