| java.lang.Object org.picocontainer.parameters.BasicComponentParameter org.picocontainer.parameters.ComponentParameter
ComponentParameter | public class ComponentParameter extends BasicComponentParameter (Code) | | A ComponentParameter should be used to pass in a particular component as argument to a
different component's constructor. This is particularly useful in cases where several
components of the same type have been registered, but with a different key. Passing a
ComponentParameter as a parameter when registering a component will give PicoContainer a hint
about what other component to use in the constructor. Collecting parameter types are
supported for
java.lang.reflect.Array ,
java.util.Collection and
java.util.Map .
author: Jon Tirsén author: Aslak Hellesøy author: Jörg Schaible author: Thomas Heller |
Method Summary | |
public void | accept(PicoVisitor visitor) Accept the visitor for the current
Parameter . | public boolean | isResolvable(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding) | public T | resolveInstance(PicoContainer container, ComponentAdapter adapter, Class<T> expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding) | public void | verify(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding) |
DEFAULT | final public static ComponentParameter DEFAULT(Code) | | DEFAULT is an instance of ComponentParameter using the default constructor.
|
ComponentParameter | public ComponentParameter(Object componentKey)(Code) | | Expect a parameter matching a component of a specific key.
Parameters: componentKey - the key of the desired addComponent |
ComponentParameter | public ComponentParameter(boolean emptyCollection)(Code) | | Expect any scalar paramter of the appropriate type or an
java.lang.reflect.Array .
Resolve the parameter even if no compoennt is of the array's component type.
Parameters: emptyCollection - true allows an Array to be empty |
ComponentParameter | public ComponentParameter(Class componentValueType, boolean emptyCollection)(Code) | | Expect any scalar paramter of the appropriate type or the collecting type
java.lang.reflect.Array ,
java.util.Collection or
java.util.Map .
The components in the collection will be of the specified type.
Parameters: componentValueType - the component's type (ignored for an Array) Parameters: emptyCollection - true allows the collection to be empty |
ComponentParameter | public ComponentParameter(Class componentKeyType, Class componentValueType, boolean emptyCollection)(Code) | | Expect any scalar paramter of the appropriate type or the collecting type
java.lang.reflect.Array ,
java.util.Collection or
java.util.Map .
The components in the collection will be of the specified type and their adapter's key
must have a particular type.
Parameters: componentKeyType - the component adapter's key type Parameters: componentValueType - the component's type (ignored for an Array) Parameters: emptyCollection - true allows the collection to be empty |
Methods inherited from org.picocontainer.parameters.BasicComponentParameter | public void accept(PicoVisitor visitor)(Code)(Java Doc) public boolean isResolvable(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)(Code)(Java Doc) public T resolveInstance(PicoContainer container, ComponentAdapter adapter, Class<T> expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)(Code)(Java Doc) public void verify(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)(Code)(Java Doc)
|
|
|