Class RegisterBeanFactories

Object
RegisterBeanFactories

public final class RegisterBeanFactories extends Object
Utility class for registering the Bean-factories that are found in anchor-bean (or any other).

Any new BeanFactory must first be registered before it can be read from BeanXML when the config-factory attribute is parsed.

Author:
Owen Feehan
  • Method Details

    • registerAllPackageBeanFactories

      public static AnchorDefaultBeanFactory registerAllPackageBeanFactories()
      Registers the factories for the beans that exist in this package

      It additionally registers the AnchorDefaultBeanFactory as the default

      If it's already been called, we simply do nothing

      Returns:
      the default factory for creating objects
    • getDefaultInstances

      public static BeanInstanceMap getDefaultInstances()
      Default instances of different family-types of beans.
      Returns:
      a mapping between family-types and instances.
    • register

      public static void register(String name, AnchorBeanFactory factory)
      Registers a specific factory.
      Parameters:
      name - name associated with factory i.e. for config-factory attribute in Xml
      factory - the factory to register
    • register

      public static <T> void register(String factoryName, Function<List<T>,Object> creator)
      Registers a bean that creates a {link java.util.List}.
      Type Parameters:
      T - list item type
      Parameters:
      factoryName - a specific factory
      creator - creator used to make list-bean
    • isCalledRegisterAllPackage

      public static boolean isCalledRegisterAllPackage()
      Has the method registerAllPackageBeanFactories() already been called?
      Returns:
      true if the method has been called (at least once), false otherwise.