Interface BeanFactory

  • All Known Implementing Classes:
    BeanCreator, BeanFactoryManager

    public interface BeanFactory
    Interface for a factory to create instances of WritableBean. In case you are implementing beans extending Bean, you can simply ignore this interface and create your instances with the new operator. However, framework code should use this interface to create instances for a given class to support the flexibility provided by this module.
    Since:
    1.0.0
    • Method Detail

      • create

        default <B extends WritableBean> B create​(Class<B> type)
        Type Parameters:
        B - type of the WritableBean.
        Parameters:
        type - the Class reflecting the WritableBean.
        Returns:
        a new instance of the WritableBean specified by the given Class. If type is an interface, a dynamic proxy implementation is generated. Otherwise if a class is given it needs to extend Bean, be non-abstract and requires a non-arg constructor.
      • create

        <B extends WritableBean> B create​(Class<B> type,
                                          boolean dynamic)
        Type Parameters:
        B - type of the WritableBean.
        Parameters:
        type - the Class reflecting the WritableBean.
        dynamic - the dynamic flag.
        Returns:
        a new instance of the WritableBean specified by the given Class. If type is an interface, a dynamic proxy implementation is generated. Otherwise if a class is given it needs to extend Bean, be non-abstract and requires a non-arg constructor.