org.simantics.databoard.binding.mutable
Class MutableVariantBinding

java.lang.Object
  extended by org.simantics.databoard.binding.Binding
      extended by org.simantics.databoard.binding.VariantBinding
          extended by org.simantics.databoard.binding.mutable.ImmutableVariantBinding
              extended by org.simantics.databoard.binding.mutable.MutableVariantBinding
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public class MutableVariantBinding
extends ImmutableVariantBinding

MutableVariantBinding binds VariantType to MutableVariant Class.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding
Binding.Visitor<T>, Binding.Visitor1
 
Constructor Summary
MutableVariantBinding(ClassBindingFactory bindingFactory, AdapterFactory adapterFactory)
           
 
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(Binding binding, java.lang.Object value)
          Create a new variant object.
 boolean isImmutable()
          Return true if the value is immutable.
 boolean isInstance(java.lang.Object obj)
           
 void setContent(java.lang.Object variant, Binding binding, java.lang.Object value)
          Set the content of an variant.
 
Methods inherited from class org.simantics.databoard.binding.mutable.ImmutableVariantBinding
getContent, getContent, getContentBinding, getContentType
 
Methods inherited from class org.simantics.databoard.binding.VariantBinding
accept, accept, createUnchecked, deepCompare, deepHashValue, getComponentBinding, getComponentBinding, getComponentCount, readFrom
 
Methods inherited from class org.simantics.databoard.binding.Binding
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandom, createRandom, createRandomUnchecked, equals, hashValue, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, readFromTry, readFromTryUnchecked, readFromUnchecked, serializer, toString, toString, 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
 

Constructor Detail

MutableVariantBinding

public MutableVariantBinding(ClassBindingFactory bindingFactory,
                             AdapterFactory adapterFactory)
Method Detail

create

public java.lang.Object create(Binding binding,
                               java.lang.Object value)
                        throws BindingException
Description copied from class: VariantBinding
Create a new variant object. The value argument may be included in the result.

Overrides:
create in class ImmutableVariantBinding
Parameters:
binding - the binding of the content
value - content
Returns:
new variant
Throws:
BindingException

isImmutable

public boolean isImmutable()
Description copied from class: Binding
Return true if the value is immutable. This question excludes the immutability of the component types.

Overrides:
isImmutable in class ImmutableVariantBinding
Returns:
true value if immutable

isInstance

public boolean isInstance(java.lang.Object obj)
Overrides:
isInstance in class ImmutableVariantBinding

assertInstaceIsValid

public void assertInstaceIsValid(java.lang.Object obj,
                                 java.util.Set<java.lang.Object> validInstances)
                          throws BindingException
Description copied from class: Binding
Assert the obj is valid data type

Overrides:
assertInstaceIsValid in class ImmutableVariantBinding
Parameters:
obj - the instance
validInstances - optional set of already validated instances
Throws:
BindingException - on invalid instance

setContent

public void setContent(java.lang.Object variant,
                       Binding binding,
                       java.lang.Object value)
                throws BindingException
Description copied from class: VariantBinding
Set the content of an variant.

Overrides:
setContent in class ImmutableVariantBinding
Parameters:
variant - variant object
binding - content's binding
value - new content
Throws:
BindingException