org.simantics.databoard.reflection
Class ConstantBinding

java.lang.Object
  extended by org.simantics.databoard.binding.Binding
      extended by org.simantics.databoard.binding.RecordBinding
          extended by org.simantics.databoard.reflection.ConstantBinding
All Implemented Interfaces:
java.util.Comparator<java.lang.Object>

public class ConstantBinding
extends RecordBinding


Nested Class Summary
 
Nested classes/interfaces inherited from class org.simantics.databoard.binding.Binding
Binding.Visitor<T>, Binding.Visitor1
 
Field Summary
 
Fields inherited from class org.simantics.databoard.binding.RecordBinding
componentBindings
 
Constructor Summary
ConstantBinding(DataType type, java.lang.Object constantValue)
           
 
Method Summary
 java.lang.Object create(java.lang.Object... value)
          Create a record using values.
 java.lang.Object createPartial()
          Creates partial and most likely invalid instance.
 java.lang.Object getComponent(java.lang.Object obj, int index)
           
 boolean isImmutable()
          Return true if the value is immutable.
 boolean isInstance(java.lang.Object obj)
           
 void setComponent(java.lang.Object obj, int index, java.lang.Object value)
           
 void setComponents(java.lang.Object obj, java.lang.Object... value)
           
 
Methods inherited from class org.simantics.databoard.binding.RecordBinding
accept, accept, assertInstaceIsValid, count, createUnchecked, deepCompare, deepHashValue, getComponentBinding, getComponentBinding, getComponentBindings, setComponentsUnchecked, setComponentUnchecked, type
 
Methods inherited from class org.simantics.databoard.binding.Binding
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandomUnchecked, equals, hashValue, main, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, serializer, serializer, serializerUnchecked, toString
 
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

ConstantBinding

public ConstantBinding(DataType type,
                       java.lang.Object constantValue)
Method Detail

create

public java.lang.Object create(java.lang.Object... value)
                        throws BindingException
Description copied from class: RecordBinding
Create a record using values. Note! values may be consumed (used in the result)

Specified by:
create in class RecordBinding
Returns:
new record
Throws:
BindingException

getComponent

public java.lang.Object getComponent(java.lang.Object obj,
                                     int index)
                              throws BindingException
Specified by:
getComponent in class RecordBinding
Throws:
BindingException

createPartial

public java.lang.Object createPartial()
                               throws BindingException
Description copied from class: RecordBinding
Creates partial and most likely invalid instance. This is used in two-phase construction of recursive instances.

Specified by:
createPartial in class RecordBinding
Returns:
instance.
Throws:
BindingException

setComponents

public void setComponents(java.lang.Object obj,
                          java.lang.Object... value)
                   throws BindingException
Specified by:
setComponents in class RecordBinding
Throws:
BindingException

setComponent

public void setComponent(java.lang.Object obj,
                         int index,
                         java.lang.Object value)
                  throws BindingException
Specified by:
setComponent in class RecordBinding
Throws:
BindingException

isInstance

public boolean isInstance(java.lang.Object obj)
Specified by:
isInstance in class Binding

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 Binding
Returns:
true value if immutable