|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.parameters.ConstantParameter
public class ConstantParameter
A ConstantParameter should be used to pass in "constant" arguments to constructors. This
includes String
s,Integer
s or any other object that is not registered in
the container.
Field Summary |
---|
Fields inherited from interface org.picocontainer.Parameter |
---|
DEFAULT, ZERO |
Constructor Summary | |
---|---|
ConstantParameter(Object value)
|
Method Summary | |
---|---|
void |
accept(PicoVisitor visitor)
Visit the current Parameter . |
boolean |
isResolvable(PicoContainer container,
ComponentAdapter adapter,
Class expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Check if the Parameter can satisfy the expected type using the container. |
Object |
resolveInstance(PicoContainer container,
ComponentAdapter adapter,
Class expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Retrieve the object from the Parameter that satisfies the expected type. |
void |
verify(PicoContainer container,
ComponentAdapter adapter,
Class expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Verify that the Parameter can satisfy the expected type using the container |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstantParameter(Object value)
Method Detail |
---|
public Object resolveInstance(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)
Parameter
resolveInstance
in interface Parameter
container
- the container from which dependencies are resolved.adapter
- the ComponentAdapter
that is asking for the instanceexpectedType
- the type that the returned instance needs to match.expectedNameBinding
- Expected parameter name
null
if no suitable instance can be found.public boolean isResolvable(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)
Parameter
isResolvable
in interface Parameter
container
- the container from which dependencies are resolved.adapter
- the ComponentAdapter
that is asking for the instanceexpectedType
- the required typeexpectedNameBinding
- Expected parameter name
true
if the component parameter can be resolved.public void verify(PicoContainer container, ComponentAdapter adapter, Class expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding) throws PicoException
verify
in interface Parameter
container
- the container from which dependencies are resolved.adapter
- the ComponentAdapter
that is asking for the verificationexpectedType
- the required typeexpectedNameBinding
- Expected parameter name
PicoCompositionException
- if parameter and its dependencies cannot be resolved
PicoException
Parameter.verify(PicoContainer, ComponentAdapter, Class, NameBinding ,boolean, Annotation)
public void accept(PicoVisitor visitor)
Parameter
.
accept
in interface Parameter
visitor
- the visitor.Parameter.accept(org.picocontainer.PicoVisitor)
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |