|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.defaults.ConstantParameter
public class ConstantParameter
A ConstantParameter should be used to pass in "constant" arguments to constructors. This
includes Strings,Integers or any other object that is not registered in
the container.
| Field Summary | |
|---|---|
private java.lang.Object |
value
|
| Constructor Summary | |
|---|---|
ConstantParameter(java.lang.Object value)
|
|
| Method Summary | |
|---|---|
void |
accept(PicoVisitor visitor)
Visit the current Parameter. |
private boolean |
checkPrimitive(java.lang.Class expectedType)
|
boolean |
isResolvable(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
Check if the Parameter can statisfy the expected type using the container. |
java.lang.Object |
resolveInstance(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
Retrieve the object from the Parameter that statisfies the expected type. |
void |
verify(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
Verify that the Parameter can statisfied the expected type using the container |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.lang.Object value
| Constructor Detail |
|---|
public ConstantParameter(java.lang.Object value)
| Method Detail |
|---|
public java.lang.Object resolveInstance(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
Parameter
resolveInstance in interface Parametercontainer - 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.
null if no suitable instance can be found.
public boolean isResolvable(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
Parameter
isResolvable in interface Parametercontainer - the container from which dependencies are resolved.adapter - the ComponentAdapter that is asking for the instanceexpectedType - the required type
true if the component parameter can be resolved.
public void verify(PicoContainer container,
ComponentAdapter adapter,
java.lang.Class expectedType)
throws PicoException
verify in interface Parametercontainer - the container from which dependencies are resolved.adapter - the ComponentAdapter that is asking for the verificationexpectedType - the required type
PicoIntrospectionException - if parameter and its dependencies cannot be resolved
PicoExceptionParameter.verify(org.picocontainer.PicoContainer,
org.picocontainer.ComponentAdapter, java.lang.Class)public void accept(PicoVisitor visitor)
Parameter.
accept in interface Parametervisitor - the visitor.Parameter.accept(org.picocontainer.PicoVisitor)private boolean checkPrimitive(java.lang.Class expectedType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||