View Javadoc

1   /*
2    * Created on May 22, 2005
3    *
4    * TTheLittleContainer dependency manager interface.
5    */
6   package net.sf.tlc.ioc.impl;
7   
8   import java.lang.reflect.Constructor;
9   
10  /***
11   * TheLittleContainer dependency manager interface.
12   * 
13   * @author aisrael
14   */
15  public interface DependencyManager {
16  
17      /***
18       * Registers a class with the DependencyManager
19       * 
20       * @param c
21       *            Class
22       */
23      void registerClass(final Class c);
24  
25      /***
26       * Returns true if the registry contains the given class.
27       * 
28       * @param c
29       *            Class
30       * @return true if the registry contains the given class
31       */
32      boolean hasClass(final Class c);
33  
34      /***
35       * Returns a list (Class[]) of all classes registered that fufill the given
36       * class (either extends the superclass or implements the interface)
37       * 
38       * @param c
39       *            Class
40       * @return Class[]
41       */
42      Class[] listAllImplementingClasses(final Class c);
43  
44      /***
45       * Returns true if the class can be constructed fulfilling the given
46       * constructor.
47       * 
48       * @param c
49       *            Class
50       * @param constructor
51       *            Constructor
52       * @return true if the class can be constructed fulfilling the given
53       *         constructor
54       */
55      boolean canConstructClass(final Class c, final Constructor constructor);
56  
57      /***
58       * Returns true if the class can be constructed fulfilling any one of its
59       * constructors (notably, the default or empty constructor).
60       * 
61       * @param c
62       *            Class
63       * @return true if the class can be constructed fulfilling any one of its
64       *         constructors
65       */
66      boolean canConstructClass(final Class c);
67  }