Class PicoBuilder


  • public class PicoBuilder
    extends Object
    Helps assembles the myriad items available to a picocontainer.

    Simple Example:

     MutablePicoContainer mpc = new PicoBuilder()
       .withCaching()
       .withLifecycle()
       .build();
     
    • Constructor Detail

      • PicoBuilder

        public PicoBuilder​(PicoContainer parentContainer)
        Constructs a PicoBuilder using the specified PicoContainer as an argument. Note that this only creates child -> parent references. You must use parentContainer.addChildContainer() to the instance built here if you require child <-> parent references.
        Parameters:
        parentContainer -
      • PicoBuilder

        public PicoBuilder()
        Will be used to build a PicoContainer not bound to any parent container.
    • Method Detail

      • withReflectionLifecycle

        public PicoBuilder withReflectionLifecycle()
        Constructed PicoContainer will use ReflectionLifecycle.
        Returns:
        this to allow for method chaining.
      • withLifecycle

        public PicoBuilder withLifecycle​(Class<? extends LifecycleStrategy> specifiedLifecycleStrategyType)
        Allows you to specify your own lifecycle strategy class.
        Parameters:
        specifiedLifecycleStrategyType - lifecycle strategy type.
        Returns:
        this to allow for method chaining.
      • withLifecycle

        public PicoBuilder withLifecycle​(LifecycleStrategy specifiedLifecycleStrategy)
        Allows you to fully specify your lifecycle strategy by passing in a built instance
        Parameters:
        specifiedLifecycleStrategy -
        Returns:
        this to allow for method chaining.
      • withConsoleMonitor

        public PicoBuilder withConsoleMonitor()
      • withHiddenImplementations

        public PicoBuilder withHiddenImplementations()
      • withSetterInjection

        public PicoBuilder withSetterInjection()
      • withAnnotatedMethodInjection

        public PicoBuilder withAnnotatedMethodInjection​(Class<? extends Annotation> injectionAnnotation)
      • withAnnotatedMethodInjection

        public PicoBuilder withAnnotatedMethodInjection()
      • withAnnotatedFieldInjection

        public PicoBuilder withAnnotatedFieldInjection​(Class<? extends Annotation> injectionAnnotation)
      • withAnnotatedFieldInjection

        public PicoBuilder withAnnotatedFieldInjection()
      • withTypedFieldInjection

        public PicoBuilder withTypedFieldInjection()
      • withConstructorInjection

        public PicoBuilder withConstructorInjection()
      • withNamedMethodInjection

        public PicoBuilder withNamedMethodInjection()
      • withNamedFieldInjection

        public PicoBuilder withNamedFieldInjection()
      • withSynchronizing

        public PicoBuilder withSynchronizing()
      • withMonitor

        public PicoBuilder withMonitor​(ComponentMonitor specifiedComponentMonitor)
        Allows you to specify your very own component monitor to be used by the created picocontainer
        Parameters:
        specifiedComponentMonitor -
        Returns:
        this to allow for method chaining.
      • withCustomContainerComponent

        public PicoBuilder withCustomContainerComponent​(Object containerDependency)
      • withPropertyApplier

        public PicoBuilder withPropertyApplier()
      • withMethodInjection

        public PicoBuilder withMethodInjection()
      • addChildToParent

        public PicoBuilder addChildToParent()