svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / dynobject / DynObjectManager.java @ 25791
History | View | Annotate | Download (3.05 KB)
1 |
package org.gvsig.tools.dynobject; |
---|---|
2 |
|
3 |
import java.util.Iterator; |
4 |
import java.util.List; |
5 |
|
6 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
7 |
import org.gvsig.tools.operations.OperationContext; |
8 |
import org.gvsig.tools.operations.OperationException; |
9 |
|
10 |
|
11 |
public interface DynObjectManager { |
12 |
|
13 |
public int NULLCODE = -1; |
14 |
|
15 |
public DynClass createDynClass(String name, String description); |
16 |
|
17 |
public boolean add(DynClass dynClass); |
18 |
|
19 |
public DynClass add(String name, String description); |
20 |
|
21 |
public DynClass add(String name); |
22 |
|
23 |
/**
|
24 |
* Obtiene el la clase asociado al nombre indicado.
|
25 |
*
|
26 |
* @param name
|
27 |
* , nombre de la clase que queremos obtener.
|
28 |
* @return la clase requerida.
|
29 |
*/
|
30 |
public DynClass get(String name); |
31 |
|
32 |
/**
|
33 |
* Comprueba si esta registrada una clase.
|
34 |
*
|
35 |
* @return true si la clase "name" esta registrada, false si no.
|
36 |
*/
|
37 |
public boolean has(String name); |
38 |
|
39 |
/**
|
40 |
* Obtiene el numero de clases registradas.
|
41 |
*
|
42 |
* @return
|
43 |
*/
|
44 |
public int getCount(); |
45 |
|
46 |
/**
|
47 |
* Obtiene un iterador sobre las clases registradas.
|
48 |
*
|
49 |
* @return
|
50 |
*/
|
51 |
public Iterator interator(); |
52 |
|
53 |
/**
|
54 |
* Obtiene la lista de nombres de las clases registradas.
|
55 |
*
|
56 |
* @return
|
57 |
*/
|
58 |
public List getNames(); |
59 |
|
60 |
|
61 |
/**
|
62 |
* Crea un nuevo objeto asociandole como clase base la indicada como
|
63 |
* parametro.
|
64 |
*
|
65 |
* @param dynClass
|
66 |
* @return el nuevo DynObject
|
67 |
*/
|
68 |
public DynObject createDynObject(DynClass dynClass);
|
69 |
|
70 |
/**
|
71 |
* Actualiza todas las DynClasses registradas para reflejar la
|
72 |
* herencia de forma adecuada.
|
73 |
*/
|
74 |
public void consolide(); |
75 |
|
76 |
|
77 |
/**
|
78 |
* Register the method in the dynClass.
|
79 |
*
|
80 |
* @param dynClass class over the method is registred
|
81 |
* @param dynMethod method to registry
|
82 |
* @return unique code of method
|
83 |
*/
|
84 |
public int registerDynMethod(DynClass dynClass, DynMethod dynMethod); |
85 |
|
86 |
/**
|
87 |
* Register the method in the class.
|
88 |
*
|
89 |
* @param theClass class over the method is registred
|
90 |
* @param dynMethod method to registry
|
91 |
* @return unique code of method
|
92 |
*/
|
93 |
public int registerDynMethod(Class theClass, DynMethod dynMethod); |
94 |
|
95 |
|
96 |
/**
|
97 |
* Obtain the method for the indicated code of the dynObject.
|
98 |
*
|
99 |
* @param dynObject
|
100 |
* @param code code of the requeted method
|
101 |
* @return the required DynMethod
|
102 |
*
|
103 |
* @throws DynMethodException
|
104 |
*/
|
105 |
public DynMethod getDynMethod(DynObject dynObject, int code) throws DynMethodException ; |
106 |
|
107 |
public DynMethod getDynMethod(DynClass dynClass, int code) throws DynMethodException; |
108 |
|
109 |
public DynMethod getDynMethod(Object obj, int code) throws DynMethodException; |
110 |
|
111 |
public DynMethod getDynMethod(Class theClass, int code) throws DynMethodException; |
112 |
|
113 |
public DynMethod getDynMethod(int code) throws DynMethodException; |
114 |
|
115 |
/**
|
116 |
* Invoke the method of the indicated code for the object self, with
|
117 |
* parameters in context.
|
118 |
*
|
119 |
* @param self object over the method is invoked
|
120 |
* @param code code for the method to invoke
|
121 |
* @param context paramters of method
|
122 |
* @return return value for the method
|
123 |
* @throws DynMethodException
|
124 |
*/
|
125 |
public Object invokeDynMethod(Object self, int code, DynObject context) throws DynMethodException; |
126 |
|
127 |
|
128 |
} |