MentaContainer

Rev

Rev 41 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 41 Rev 45
Line 2... Line 2...
2
2
3
/**
3
/**
4
 * An IoC component that knows how to create instances of itself and accepts init values for its constructor
-
 
5
 * and properties to be injected through its setters.
-
 
-
 
4
 * An IoC component that knows how to create instances of itself.
6
 *
5
 *
7
 * @author sergio.oliveira.jr@gmail.com
6
 * @author sergio.oliveira.jr@gmail.com
8
 */
7
 */
9
public interface Component {
8
public interface Component {
10
       
9
       
Line 12... Line 11...
12
         * Instantiate the bean.
11
         * Instantiate the bean.
13
         *
12
         *
14
         * @return The instantiated bean based on the container configuration.
13
         * @return The instantiated bean based on the container configuration.
15
         */
14
         */
16
        public <T> T getInstance();
15
        public <T> T getInstance();
17
       
-
 
18
        /**
-
 
19
         * Add a constructor parameter to be used when the bean is instantiated. It can be called more than once to
-
 
20
         * use constructors with more than one argument.
-
 
21
         *
-
 
22
         * @param value A parameter value to be used by a constructor.
-
 
23
         * @return The component itself. (Fluent API)
-
 
24
         */
-
 
25
        public Component addInitValue(Object value);
-
 
26
       
-
 
27
        /**
-
 
28
         * Add a property to be injected through a setter when the component is instantiated.
-
 
29
         *
-
 
30
         * @param name The property name.
-
 
31
         * @param value The property value.
-
 
32
         * @return The component itself. (Fluent API)
-
 
33
         */
-
 
34
        public Component addProperty(String name, Object value);
-
 
35
       
16
       
36
        /**
17
        /**
37
         * Is this component a singleton component, in other words,
18
         * Is this component a singleton component, in other words,
38
         * it always returns the same instance?
19
         * it always returns the same instance?
39
         *
20
         *