|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.binding.reflection.ClassBindingFactory
public class ClassBindingFactory
Type Factory constructs data types from reflection requests. Successfully constructed types are placed in the repository that was given at construction time.
Constructor Summary | |
---|---|
ClassBindingFactory()
Construct a new reflection binding factory |
|
ClassBindingFactory(BindingRepository repository)
Construct a new reflection binding factory that places constructed bindings into user given repository. |
Method Summary | ||
---|---|---|
void |
addFactory(BindingSubFactory factory)
|
|
Binding |
construct(BindingRequest request)
|
|
Binding |
getBinding(BindingRequest request)
|
|
|
getBinding(java.lang.Class<?> clazz)
Get a binding to a Java Class. |
|
|
getBinding(java.lang.Class<?> clazz,
java.lang.Class<?>... parameters)
Get a binding to a Java Class. |
|
Binding |
getBindingUnchecked(BindingRequest request)
|
|
static java.lang.annotation.Annotation[] |
getFieldAnnotations(java.lang.reflect.Field field)
|
|
BindingRepository |
getRepository()
|
|
void |
removeFactory(BindingSubFactory factory)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassBindingFactory()
public ClassBindingFactory(BindingRepository repository)
repository
- Method Detail |
---|
public void addFactory(BindingSubFactory factory)
public void removeFactory(BindingSubFactory factory)
public BindingRepository getRepository()
public Binding construct(BindingRequest request) throws BindingConstructionException
BindingConstructionException
public <T extends Binding> T getBinding(java.lang.Class<?> clazz) throws BindingConstructionException
The whether the result binding is a completely mutable or not depends on the provided classes. For instance, fields such as Boolean, Integer, Long are not mutable, instead MutableBoolean, MutableInteger and MutableLong are. The length of Object[] is not mutable, but length of List
public <T extends Binding> T getBinding(java.lang.Class<?> clazz, java.lang.Class<?>... parameters) throws BindingConstructionException
Example 1:
Binding binding = getBinding(Map.class, String.class, Integer.class);
Map
> list = (List
>) d.createRandom(5);
clazz
-
BindingConstructionException
ClassBindingFactory
public Binding getBinding(BindingRequest request) throws BindingConstructionException
BindingConstructionException
public Binding getBindingUnchecked(BindingRequest request) throws RuntimeBindingConstructionException
RuntimeBindingConstructionException
public static java.lang.annotation.Annotation[] getFieldAnnotations(java.lang.reflect.Field field)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |