public class ConstantParameter extends AbstractParameter implements Parameter, Serializable
String
s,Integer
s or any other object that is not registered in
the container.Parameter.DelegateResolver, Parameter.NotResolved, Parameter.Resolver, Parameter.ValueResolver
Constructor and Description |
---|
ConstantParameter(Object value) |
Modifier and Type | Method and Description |
---|---|
void |
accept(PicoVisitor visitor)
Visit the current
Parameter . |
protected boolean |
isAssignable(Type expectedType) |
Parameter.Resolver |
resolve(PicoContainer container,
ComponentAdapter<?> forAdapter,
ComponentAdapter<?> injecteeAdapter,
Type expectedType,
NameBinding expectedNameBinding,
boolean useNames,
Annotation binding)
Check if the Parameter can satisfy the expected type using the container.
|
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
|
isResolvable, resolveInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isResolvable, resolveInstance
public ConstantParameter(Object value)
public Parameter.Resolver resolve(PicoContainer container, ComponentAdapter<?> forAdapter, ComponentAdapter<?> injecteeAdapter, Type expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)
Parameter
resolve
in interface Parameter
container
- the container from which dependencies are resolved.forAdapter
- the ComponentAdapter
that is asking for the instanceinjecteeAdapter
- the adapter to be injected into (null for N/A)expectedType
- the required typeexpectedNameBinding
- Expected parameter nameuseNames
- should use parameter names for disambiguationbinding
- @return 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 Parameter
container
- the container from which dependencies are resolved.adapter
- the ComponentAdapter
that is asking for the verificationexpectedType
- the required typeexpectedNameBinding
- Expected parameter namePicoCompositionException
- if parameter and its dependencies cannot be resolvedPicoException
Parameter.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 Parameter
visitor
- the visitor.Parameter.accept(org.picocontainer.PicoVisitor)
Copyright © 2003–2016 Codehaus. All rights reserved.