MentaContainer

Rev

Rev 95 | Rev 99 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
45 soliveira 1
package org.mentacontainer;
2
 
3
/**
95 soliveira 4
 * An IoC factory that knows how to create instances of itself and
45 soliveira 5
 * can be configured by accepting values for its constructor
86 soliveira 6
 * and properties for its setters. It can also be intercepted right
87 soliveira 7
 * after it is created/wired and right before it is destroyed through
8
 * the Interceptable interface.
45 soliveira 9
 *
10
 * @author sergio.oliveira.jr@gmail.com
11
 */
88 soliveira 12
public interface ConfigurableFactory extends Factory {
45 soliveira 13
 
14
        /**
15
         * Add a constructor parameter to be used when the bean is instantiated. It can be called more than once to
16
         * use constructors with more than one argument.
17
         *
18
         * @param value A parameter value to be used by a constructor.
95 soliveira 19
         * @return The factory itself. (Fluent API)
45 soliveira 20
         */
88 soliveira 21
        public ConfigurableFactory addInitValue(Object value);
45 soliveira 22
 
92 soliveira 23
        public ConfigurableFactory addInitPrimitive(Object value);
24
 
96 soliveira 25
        public ConfigurableFactory addInitDependency(String key);
26
 
27
        public ConfigurableFactory useZeroArgumentConstructor();
28
 
45 soliveira 29
        /**
95 soliveira 30
         * Add a property to be injected through a setter when the factory is instantiated.
45 soliveira 31
         *
32
         * @param name The property name.
33
         * @param value The property value.
95 soliveira 34
         * @return The factory itself. (Fluent API)
45 soliveira 35
         */
91 soliveira 36
        public ConfigurableFactory addPropertyValue(String name, Object value);
37
 
38
        public ConfigurableFactory addPropertyDependency(String property, String key);
45 soliveira 39
}