01: package dalma.container.model;
02:
03: /**
04: * Injects a value as a property into an object.
05: *
06: * @author Kohsuke Kawaguchi
07: */
08: abstract class Injector<T, V> {
09: /**
10: * Name of the property that this {@link Injector} represents.
11: */
12: public abstract String getName();
13:
14: /**
15: * Gets the type of the property.
16: */
17: public final Class<V> getType() {
18: Class t = _getType();
19: if (t == int.class)
20: t = Integer.class;
21: return t;
22: }
23:
24: protected abstract Class<V> _getType();
25:
26: /**
27: * Injects a value.
28: */
29: public abstract void set(T target, V value)
30: throws InjectionException;
31: }
|