MentaContainer

Rev

Blame | Last modification | View Log | RSS feed

package org.mentacontainer;

/**
 * An IoC component that knows how to create instances of itself and
 * can be configured by accepting values for its constructor
 * and properties for its setters.
 *
 * @author sergio.oliveira.jr@gmail.com
 */

public interface ConfigurableComponent extends Component {
       
        /**
         * Add a constructor parameter to be used when the bean is instantiated. It can be called more than once to
         * use constructors with more than one argument.
         *
         * @param value A parameter value to be used by a constructor.
         * @return The component itself. (Fluent API)
         */

        public ConfigurableComponent addInitValue(Object value);
       
        /**
         * Add a property to be injected through a setter when the component is instantiated.
         *
         * @param name The property name.
         * @param value The property value.
         * @return The component itself. (Fluent API)
         */

        public ConfigurableComponent addProperty(String name, Object value);
}