public class AttributeBinderInjector extends Object
AttributeBinder. The injector
can recursively inject values to the designated non-static fields of the root injection
receiver object. Such an injector can be useful to set references to common resources
(e.g. internal processing contexts) on an object hierarchy.| Constructor and Description |
|---|
AttributeBinderInjector() |
| Modifier and Type | Method and Description |
|---|---|
static void |
injectByType(Class<? extends Annotation> injectableMarker,
Map<Class<?>,Object> values,
Object... objects)
Injects values to an object's non-static fields by value type.
|
public static void injectByType(Class<? extends Annotation> injectableMarker, Map<Class<?>,Object> values, Object... objects)
injectableMarker - a marker interface that designates injection receiversvalues - a mapping between field type and the value to set, null
values are allowed and will be transferred to the object's fields. If
the map does not contain a key equal an object field's type, the field's
value will not be changed.objects - All objects whose fields should be set. Objects must be marked with the
injectableMarker annotation. All objects' fields whose
types are marked with the injectableMarker will also
recursively receive value injection.Copyright © 2013 Carrot2.org. All Rights Reserved.