01: package org.geotools.xml;
02:
03: import org.picocontainer.ComponentAdapter;
04: import org.picocontainer.PicoContainer;
05: import org.picocontainer.defaults.BasicComponentParameter;
06:
07: /**
08: * A pico container "parameter" which allows one to make setter injection
09: * optional.
10: * <p>
11: * This class is a hack of pico container... it should be used with care.
12: * </p>
13: *
14: * @author Justin Deoliveira, The Open Planning Project
15: *
16: */
17: public class OptionalComponentParameter extends BasicComponentParameter {
18:
19: public OptionalComponentParameter() {
20: super ();
21:
22: }
23:
24: public OptionalComponentParameter(Object componentKey) {
25: super (componentKey);
26:
27: }
28:
29: /**
30: * Always return true, because since the setter is optional even its not
31: * in teh container we can always resolve to <code>null</code>.
32: */
33: public boolean isResolvable(PicoContainer container,
34: ComponentAdapter adapter, Class expectedType) {
35: return true;
36: }
37: }
|