Class CompositeBinder

  • All Implemented Interfaces:
    Binder

    public class CompositeBinder
    extends AbstractBinder
    Utility class which is able to install several binders and register them as a whole.

    Binder is able to recursively register all injection binding descriptions in all installed binders.

    • Field Detail

      • installed

        private java.util.Collection<Binder> installed
    • Constructor Detail

      • CompositeBinder

        private CompositeBinder​(java.util.Collection<Binder> installed)
        Creates a new CompositeBinder and adds the collection of binders as candidates to install.
        Parameters:
        installed - all binder ready to install.
    • Method Detail

      • wrap

        public static AbstractBinder wrap​(java.util.Collection<Binder> binders)
        Creates CompositeBinder with provided binders.
        Parameters:
        binders - provided binder to install as a collection.
        Returns:
        composite binder.
      • wrap

        public static AbstractBinder wrap​(Binder... binders)
        Creates CompositeBinder with provided binders.
        Parameters:
        binders - provided binder to install as an array.
        Returns:
        composite binder.
      • configure

        public void configure()
        Automatically installed all provided binders.
        Specified by:
        configure in class AbstractBinder