|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.binding.Binding
org.simantics.databoard.binding.VariantBinding
org.simantics.databoard.reflection.ObjectVariantBinding
public class ObjectVariantBinding
ObjectVariantBinding binds VarianType and Object.class. The implementation is immutable as Object.class is not a container, it is a value.
ObjectVariantBinding understands many classes
Collections: ArrayList, List, LinkedList, int[], .., other arrays [], Map, TreeMap, HashMap, Set, HashSet, TreeSet,
Strings: String
immutable primitives: Integer, Boolean, ...
mutable primitives: MutableInteger, MutableBoolean, ...
classes: Record-classes, Bean-Classes, Immutable-Classes
null
is bound to a void.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding |
---|
Binding.Visitor<T>, Binding.Visitor1 |
Field Summary | |
---|---|
static ObjectVariantBinding |
INSTANCE
|
Constructor Summary | |
---|---|
ObjectVariantBinding(ReflectionBinding reflection)
|
Method Summary | |
---|---|
void |
assertInstaceIsValid(java.lang.Object obj,
java.util.Set<java.lang.Object> validInstances)
Assert the obj is valid data type |
java.lang.Object |
create(java.lang.Object value,
Binding binding)
Create a new variant object. |
Binding |
getBinding(java.lang.Object variant)
Returns a suggestion for the binding of the value of the variant. |
DataType |
getType(java.lang.Object variant)
|
java.lang.Object |
getValue(java.lang.Object variant)
Get the value of the variant. |
java.lang.Object |
getValue(java.lang.Object variant,
Binding binding)
Get the value in the variant. |
boolean |
isImmutable()
Return true if the value is immutable. |
boolean |
isInstance(java.lang.Object obj)
|
void |
setValue(java.lang.Object variant,
java.lang.Object value,
Binding binding)
Set the value of an existing variant container. |
Methods inherited from class org.simantics.databoard.binding.VariantBinding |
---|
accept, accept, createUnchecked, deepCompare, deepHashValue |
Methods inherited from class org.simantics.databoard.binding.Binding |
---|
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandomUnchecked, equals, hashValue, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, serializer, serializer, serializerUnchecked, type |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static ObjectVariantBinding INSTANCE
Constructor Detail |
---|
public ObjectVariantBinding(ReflectionBinding reflection)
Method Detail |
---|
public java.lang.Object create(java.lang.Object value, Binding binding) throws BindingException
VariantBinding
value
argument may be included in the result.
create
in class VariantBinding
BindingException
public Binding getBinding(java.lang.Object variant) throws BindingException
VariantBinding
getBinding
in class VariantBinding
BindingException
public DataType getType(java.lang.Object variant) throws BindingException
getType
in class VariantBinding
BindingException
public java.lang.Object getValue(java.lang.Object variant, Binding binding) throws BindingException
VariantBinding
variant
.
getValue
in class VariantBinding
BindingException
public java.lang.Object getValue(java.lang.Object variant) throws BindingException
VariantBinding
VariantBinding.getBinding(Object)
.
getValue
in class VariantBinding
BindingException
public void setValue(java.lang.Object variant, java.lang.Object value, Binding binding) throws BindingException
VariantBinding
setValue
in class VariantBinding
BindingException
public void assertInstaceIsValid(java.lang.Object obj, java.util.Set<java.lang.Object> validInstances) throws BindingException
Binding
assertInstaceIsValid
in class Binding
obj
- the instancevalidInstances
- optional set of already validated instances
BindingException
- on invalid instancepublic boolean isInstance(java.lang.Object obj)
isInstance
in class Binding
public boolean isImmutable()
Binding
isImmutable
in class Binding
true
value if immutable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |