Class BindingLoader


  • public class BindingLoader
    extends Object
    Stores a list of binding classes and provides ways to load or get a specific Binding object based on QName. It can handle storage of classes that support the ComponentAdapter interface or other classes but will attempt to instantiate and return a Binding object.

    It uses a Context (otherwise known as PicoContainer) to instantiate the relevant object and understand the dependencies that should also be loaded. The Context is required to be passed in by the caller

    • Constructor Detail

      • BindingLoader

        public BindingLoader​(Map<QName,​Object> bindings)
    • Method Detail

      • loadBinding

        public Binding loadBinding​(QName qName,
                                   PicoContainer context)
        Loads a binding with a specific QName into a context.
        Parameters:
        qName - The qualified name of the type of the binding object.
        context - The context which is to contain the binding.
        Returns:
        The binding object of the associated type, otherwise null if no such binding could be created.
      • loadBinding

        public Binding loadBinding​(QName qName,
                                   Class bindingClass,
                                   PicoContainer context)
        Loads a binding with a specific class into a context.
        Parameters:
        bindingClass - The class of the binding.
        context - The context which is to contain the binding.
        Returns:
        The binding object of the associated type, otherwise null if no such binding could be created.
      • getBinding

        protected ComponentAdapter getBinding​(QName type)
        Returns the component adapter for a binding with the specified name.
        Parameters:
        type - The qualified name of the type of the binding.
        Returns:
        The binding class, or null if no such class exists.