|
|
|||||||||
| 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 Strings,Integers 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. |
protected boolean |
isAssignable(Type expectedType)
|
boolean |
isResolvable(PicoContainer container,
ComponentAdapter<?> adapter,
Type 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,
Type expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Retrieve the object from the Parameter that satisfies the expected type. |
void |
verify(PicoContainer container,
ComponentAdapter<?> adapter,
Type 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,
Type expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
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.expectedNameBinding - Expected parameter name
null if no suitable instance can be found.
public boolean isResolvable(PicoContainer container,
ComponentAdapter<?> adapter,
Type expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Parameter
isResolvable in interface Parametercontainer - 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,
Type expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
throws PicoException
verify in interface Parametercontainer - 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
PicoExceptionParameter.verify(org.picocontainer.PicoContainer,org.picocontainer.ComponentAdapter,java.lang.reflect.Type,org.picocontainer.NameBinding,boolean,java.lang.annotation.Annotation)protected boolean isAssignable(Type expectedType)
public void accept(PicoVisitor visitor)
Parameter.
accept in interface Parametervisitor - the visitor.Parameter.accept(org.picocontainer.PicoVisitor)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||