org.simantics.databoard.reflection
Class ReflectionBinding

java.lang.Object
  extended by org.simantics.databoard.reflection.ReflectionBinding

public class ReflectionBinding
extends java.lang.Object

Reflection Binding creates bindings and types of Java Classes. o See org.simantics.databoard.annotations for type-class annotations. o List, ArrayList, primitive[] are bound to Array Type o Map, HashMap and TreeMap are bound to Map(?, ?) o Set, TreeSet and HashSet are bound to Map(T, {}) o Void.class is bound to an empty record {}. o Object.class is bound to an immutable variant. o Exception StackTraces are omited. o Classes are bound to a Record Type. There are three types classes supported: 1) record-like class - All fields are public - No-argument public constructor 2) immutable-like class - All fields are assigneed in the constructor 3) bean-like class - All fields are set with getter/setter

Author:
Toni Kalajainen

Constructor Summary
ReflectionBinding()
           
 
Method Summary
static void _getAllFields(java.lang.Class<?> clazz, java.util.Collection<java.lang.reflect.Field> result)
           
 Binding getBinding(java.lang.Class<?> clazz)
          Read binding and type from a class.
 DataType getDataType(java.lang.Class<?> clazz)
          Read representation from a class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionBinding

public ReflectionBinding()
Method Detail

getDataType

public DataType getDataType(java.lang.Class<?> clazz)
                     throws DataTypeConstructionException
Read representation from a class. DataType details and parameters are read as annotations placed in the class. (See org.simantics.databoard.annotations)

As an exception, in the subclasses of Throwable, the fields of Throwable are omited.

Parameters:
clazz -
Returns:
data type
Throws:
DataTypeConstructionException

getBinding

public Binding getBinding(java.lang.Class<?> clazz)
                   throws BindingConstructionException
Read binding and type from a class. DataType details and parameters are read as annotations placed in the class. (See org.simantics.databoard.annotations)

As an exception, in the subclasses of Throwable, the fields of Throwable are omited.

Parameters:
clazz -
Returns:
binding
Throws:
BindingConstructionException

_getAllFields

public static void _getAllFields(java.lang.Class<?> clazz,
                                 java.util.Collection<java.lang.reflect.Field> result)