Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / dynobject / DynObjectManager.java @ 25919

History | View | Annotate | Download (3.15 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

    
8

    
9
public interface DynObjectManager {
10

    
11
        public int NULLCODE = -1;
12

    
13
        public DynClass createDynClass(String name, String description);
14

    
15
        public boolean add(DynClass dynClass);
16

    
17
        public DynClass add(String name, String description);
18

    
19
        public DynClass add(String name);
20

    
21
        /**
22
         * Obtiene el la clase asociado al nombre indicado.
23
         *
24
         * @param name
25
         *            , nombre de la clase que queremos obtener.
26
         * @return la clase requerida.
27
         */
28
        public DynClass get(String name);
29

    
30
        /**
31
         * Comprueba si esta registrada una clase.
32
         *
33
         * @return true si la clase "name" esta registrada, false si no.
34
         */
35
        public boolean has(String name);
36

    
37
        /**
38
         * Obtiene el numero de clases registradas.
39
         *
40
         * @return
41
         */
42
        public int getCount();
43

    
44
        /**
45
         * Obtiene un iterador sobre las clases registradas.
46
         *
47
         * @return
48
         */
49
        public Iterator interator();
50

    
51
        /**
52
         * Obtiene la lista de nombres de las clases registradas.
53
         *
54
         * @return
55
         */
56
        public List getNames();
57

    
58

    
59
        /**
60
         * Crea un nuevo objeto asociandole como clase base la indicada como
61
         * parametro.
62
         *
63
         * @param dynClass
64
         * @return el nuevo DynObject
65
         */
66
        public DynObject createDynObject(DynClass dynClass);
67

    
68
        /**
69
         * Crea un nuevo objeto asociandole como clase base la indicada que tiene el
70
         * nombre indicado.
71
         * 
72
         * @param dynClassName
73
         * @return el nuevo DynObject
74
         */
75
        public DynObject createDynObject(String dynClassName);
76

    
77
        /**
78
         * Actualiza todas las DynClasses registradas para reflejar la
79
         * herencia de forma adecuada.
80
         */
81
        public void consolide();
82

    
83

    
84
        /**
85
         * Register the method in the dynClass.
86
         *
87
         * @param dynClass class over the method is registred
88
         * @param dynMethod method to registry
89
         * @return unique code of method
90
         */
91
        public int registerDynMethod(DynClass dynClass, DynMethod dynMethod);
92

    
93
        /**
94
         * Register the method in the class.
95
         *
96
         * @param theClass class over the method is registred
97
         * @param dynMethod method to registry
98
         * @return unique code of method
99
         */
100
        public int registerDynMethod(Class theClass, DynMethod dynMethod);
101

    
102

    
103
        /**
104
         * Obtain the method for the indicated code of the dynObject.
105
         *
106
         * @param dynObject
107
         * @param code code of the requeted method
108
         * @return the required DynMethod
109
         *
110
         * @throws DynMethodException
111
         */
112
        public DynMethod getDynMethod(DynObject dynObject, int code) throws DynMethodException ;
113

    
114
        public DynMethod getDynMethod(DynClass dynClass, int code) throws DynMethodException;
115

    
116
        public DynMethod getDynMethod(Object obj, int code) throws DynMethodException;
117

    
118
        public DynMethod getDynMethod(Class theClass, int code) throws DynMethodException;
119

    
120
        public DynMethod getDynMethod(int code) throws DynMethodException;
121

    
122
        /**
123
         * Invoke the method of the indicated code for the object self, with
124
         * parameters in context.
125
         *
126
         * @param self object over the method is invoked
127
         * @param code code for the method to invoke
128
         * @param context paramters of method
129
         * @return return value for the method
130
         * @throws DynMethodException
131
         */
132
        public Object invokeDynMethod(Object self, int code, DynObject context) throws DynMethodException;
133

    
134

    
135
}