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
    • 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