2 Information between databoard's datatype and Java classes are transferred using a ''[javadoc/org/simantics/databoard/binding/Binding.html Binding]''.
3 The type and hierarchy structure of binding is same as its repsective type and [javadoc/org/simantics/databoard/type/Datatype.html Datatype].
4 As datatype has tree-structure, so does a binding.
6 {| border="1" cellpadding="3" cellspacing="0" align="center"
7 | '''#'''||'''Type'''||'''Description'''
9 | -||[javadoc/org/simantics/databoard/binding/Binding.java|Binding]||Base class for all Bindings
11 | 0-5||[javadoc/org/simantics/databoard/binding/BooleanBinding.java|BooleanBinding],[javadoc/org/simantics/databoard/binding/ByteBinding.java|ByteBinding],[javadoc/org/simantics/databoard/binding/IntBinding.java|IntBinding],[javadoc/org/simantics/databoard/binding/LongBinding.java|LongBinding],[javadoc/org/simantics/databoard/binding/FloatBinding.java|FloatBinding],[javadoc/org/simantics/databoard/binding/DoubleBinding.java|DoubleBinding]||Primitive and numeric Bindings
13 | 6||[javadoc/org/simantics/databoard/binding/StringBinding.java|StringBinding]|| String
15 | 7||[javadoc/org/simantics/databoard/binding/RecordBinding.java|RecordBinding]|| Record
17 | 8||[javadoc/org/simantics/databoard/binding/ArrayBinding.java|ArrayBinding]|| Array - an ordered sequence of elements of one value.
19 | 9||[javadoc/org/simantics/databoard/binding/MapBinding.java|MapBinding]|| Map - an ''ordered'' map of keys to values.
21 | 11||[javadoc/org/simantics/databoard/binding/UnionBinding.java|UnionBinding]|| Union
23 | 10||[javadoc/org/simantics/databoard/binding/OptionalBinding.java|OptionalBinding]|| Optional value
25 | 12||[javadoc/org/simantics/databoard/binding/VariantBinding.java|VariantBinding]|| Variant value
31 To acquire a binding, the developer can use a utility that creates one using Java reflection functions.
32 Binding binding = Bindings.getBinding( Double.class );
34 The Binding implementation is based on reflection or constructed from byte-code at runtime. Reflection is used if ASM library is not available.
36 An automatic mechanism can create binding out of Java class, provided that certain rules are followed.
38 ''Record-like class:''
49 public Foo(String name, Object value) {
54 public String getName() {
58 public Object getValue() {
64 ''Bean-like classes:''
69 public void setName(String name) {
73 public void setValue(Object value) {
77 public String getName() {
81 public Object getValue() {
88 You can aid the Binding creation with annotations.
90 such as @Recursive, @Optional, @Arguments.
92 {| style="background-color: #e9e9e9; border: 1px solid #aaaaaa; "
98 ==Hand-Written Binding==