Class OptionalComponentParameter

  • All Implemented Interfaces:
    Serializable, Parameter

    public class OptionalComponentParameter
    extends BasicComponentParameter
    A pico container "parameter" which allows one to make setter injection optional.

    This class is a hack of pico container... it should be used with care.

    Author:
    Justin Deoliveira, The Open Planning Project
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class BasicComponentParameter

        BASIC_DEFAULT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isResolvable​(PicoContainer container, ComponentAdapter adapter, Class expectedType)
      Always return true, because since the setter is optional even its not in the container we can always resolve to null.
      • Methods inherited from class BasicComponentParameter

        accept, resolveInstance, verify
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OptionalComponentParameter

        public OptionalComponentParameter()
      • OptionalComponentParameter

        public OptionalComponentParameter​(Object componentKey)
    • Method Detail

      • isResolvable

        public boolean isResolvable​(PicoContainer container,
                                    ComponentAdapter adapter,
                                    Class expectedType)
        Always return true, because since the setter is optional even its not in the container we can always resolve to null.
        Specified by:
        isResolvable in interface Parameter
        Overrides:
        isResolvable in class BasicComponentParameter