Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.picocontainer.parameters
Class ConstantParameter

    java.lang.Object
      org.picocontainer.parameters.ConstantParameter

All Implemented Interfaces:
  Serializable, Parameter

    public class ConstantParameter

extends Object
implements Parameter, Serializable

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.

Author:
  Jon Tirsén, Aslak Hellesøy, Jörg Schaible, Thomas Heller
See Also:
  Serialized Form

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

### ConstantParameter

    public ConstantParameter(Object value)

Method Detail

### resolveInstance

    public Object resolveInstance(PicoContainer container,
                                  ComponentAdapter<?> adapter,
                                  Type expectedType,
                                  NameBinding expectedNameBinding,
                                  boolean useNames,
                                  Annotation binding)

  Description copied from interface: `Parameter`
  Retrieve the object from the Parameter that satisfies the expected type.

  Specified by:
    `resolveInstance` in interface `Parameter`
  Parameters:
    `container` - the container from which dependencies are resolved.
    `adapter` - the `ComponentAdapter` that is asking for the instance
    `expectedType` - the type that the returned instance needs to match.
    `expectedNameBinding` - Expected parameter name
  Returns:
    the instance or `null` if no suitable instance can be found.

### isResolvable

    public boolean isResolvable(PicoContainer container,
                                ComponentAdapter<?> adapter,
                                Type expectedType,
                                NameBinding expectedNameBinding,
                                boolean useNames,
                                Annotation binding)

  Description copied from interface: `Parameter`
  Check if the Parameter can satisfy the expected type using the container.

  Specified by:
    `isResolvable` in interface `Parameter`
  Parameters:
    `container` - the container from which dependencies are resolved.
    `adapter` - the `ComponentAdapter` that is asking for the instance
    `expectedType` - the required type
    `expectedNameBinding` - Expected parameter name
  Returns:
    `true` if the component parameter can be resolved.

### verify

    public void verify(PicoContainer container,
                       ComponentAdapter<?> adapter,
                       Type expectedType,
                       NameBinding expectedNameBinding,
                       boolean useNames,
                       Annotation binding)
                throws PicoException

  Verify that the Parameter can satisfy the expected type using the container

  Specified by:
    `verify` in interface `Parameter`
  Parameters:
    `container` - the container from which dependencies are resolved.
    `adapter` - the `ComponentAdapter` that is asking for the verification
    `expectedType` - the required type
    `expectedNameBinding` - Expected parameter name
  Throws:
    `PicoCompositionException` - if parameter and its dependencies cannot be resolved
    `PicoException`
  See Also:
    `Parameter.verify(org.picocontainer.PicoContainer,org.picocontainer.ComponentAdapter,java.lang.reflect.Type,org.picocontainer.NameBinding,boolean,java.lang.annotation.Annotation)`

### isAssignable

    protected boolean isAssignable(Type expectedType)

### accept

    public void accept(PicoVisitor visitor)

  Visit the current `Parameter`.

  Specified by:
    `accept` in interface `Parameter`
  Parameters:
    `visitor` - the visitor.
  See Also:
    `Parameter.accept(org.picocontainer.PicoVisitor)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 Codehaus. All Rights Reserved.