author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 16 Dec 2012 21:04:02 +0100 | |
branch | directory_structure_refactoring |
changeset 1899 | 800c0f76adce |
parent 1818 | 2e5ed72e7dfd |
child 1848 | b508cc4d4bf0 |
permissions | -rw-r--r-- |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
1 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
3 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
5 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
7 |
SWING Research Group, Czech Technical University in Prague |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
8 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
9 |
This software is furnished under a license and may be used |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
10 |
only in accordance with the terms of that license and with the |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
11 |
inclusion of the above copyright notice. This software may not |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
12 |
be provided or otherwise made available to, or used by, any |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
13 |
other person. No title to or ownership of the software is |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
14 |
hereby transferred. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
15 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
19 |
as of 1.9.2010 |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
20 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
21 |
"{ Package: 'stx:libjava' }" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
22 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
23 |
Object subclass:#JavaMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
24 |
instanceVariableNames:'klass reflection' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
25 |
classVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
26 |
poolDictionaries:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
27 |
category:'Languages-Java-Classes' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
28 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
29 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
30 |
JavaMirror subclass:#AlienClassMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
31 |
instanceVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
32 |
classVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
33 |
poolDictionaries:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
34 |
privateIn:JavaMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
35 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
36 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
37 |
JavaMirror subclass:#JavaArrayMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
38 |
instanceVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
39 |
classVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
40 |
poolDictionaries:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
41 |
privateIn:JavaMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
42 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
43 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
44 |
JavaMirror subclass:#JavaClassMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
45 |
instanceVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
46 |
classVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
47 |
poolDictionaries:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
48 |
privateIn:JavaMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
49 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
50 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
51 |
JavaMirror subclass:#JavaPrimitiveMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
52 |
instanceVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
53 |
classVariableNames:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
54 |
poolDictionaries:'' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
55 |
privateIn:JavaMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
56 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
57 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
58 |
!JavaMirror class methodsFor:'documentation'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
59 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
60 |
copyright |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
61 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
62 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
63 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
64 |
New code and modifications done at SWING Research Group [1]: |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
65 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
66 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
67 |
SWING Research Group, Czech Technical University in Prague |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
68 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
69 |
This software is furnished under a license and may be used |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
70 |
only in accordance with the terms of that license and with the |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
71 |
inclusion of the above copyright notice. This software may not |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
72 |
be provided or otherwise made available to, or used by, any |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
73 |
other person. No title to or ownership of the software is |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
74 |
hereby transferred. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
75 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
76 |
[1] Code written at SWING Research Group contains a signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
77 |
of one of the above copright owners. For exact set of such code, |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
78 |
see the differences between this version and version stx:libjava |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
79 |
as of 1.9.2010 |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
80 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
81 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
82 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
83 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
84 |
documentation |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
85 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
86 |
Instances of a JavaCassMirror provide unified access to |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
87 |
Java reflective data (expeccially to methods, constructors and |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
88 |
fields) as required by Java reflection API. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
89 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
90 |
Different classes may use different mirrors - for example, |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
91 |
Smalltalk classes use a special mirror so non-Smalltalk classes |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
92 |
and instances could be introspected and manipulated by standard |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
93 |
Java code. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
94 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
95 |
[author:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
96 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
97 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
98 |
[instance variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
99 |
klass ........ the real class on which receiver reflects |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
100 |
reflection ... now always a JavaVM reflection. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
101 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
102 |
[class variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
103 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
104 |
[see also:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
105 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
106 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
107 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
108 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
109 |
!JavaMirror class methodsFor:'instance creation'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
110 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
111 |
forClass: aClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
112 |
^self new setKlass: aClass. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
113 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
114 |
"Created: / 31-07-2012 / 17:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
115 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
116 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
117 |
!JavaMirror class methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
118 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
119 |
mirrorClassForAlienClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
120 |
^ AlienClassMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
121 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
122 |
"Created: / 31-07-2012 / 17:36:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
123 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
124 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
125 |
mirrorClassForJavaArray |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
126 |
^ JavaArrayMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
127 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
128 |
"Created: / 31-07-2012 / 18:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
129 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
130 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
131 |
mirrorClassForJavaClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
132 |
^ JavaClassMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
133 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
134 |
"Created: / 31-07-2012 / 17:36:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
135 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
136 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
137 |
mirrorClassForJavaPrimitive |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
138 |
^ JavaPrimitiveMirror |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
139 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
140 |
"Created: / 31-07-2012 / 18:27:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
141 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
142 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
143 |
!JavaMirror methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
144 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
145 |
getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
146 |
"Returns a class loader that loaded this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
147 |
^self subclassResponsibility |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
148 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
149 |
"Created: / 31-07-2012 / 18:25:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
150 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
151 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
152 |
getDeclaredConstructors: publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
153 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
1648 | 154 |
declared by this class. " |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
155 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
156 |
^self subclassResponsibility |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
157 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
158 |
"Created: / 31-07-2012 / 18:39:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
159 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
160 |
|
1648 | 161 |
getDeclaredFields: publicOnly |
162 |
"Returns an java.lang.reflect.Field[] with all constructors |
|
163 |
declared by this class." |
|
164 |
||
165 |
^self subclassResponsibility |
|
166 |
||
167 |
"Created: / 22-08-2012 / 12:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
168 |
! |
|
169 |
||
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
170 |
getDeclaredMethods:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
171 |
"Returns an java.lang.reflect.Method[] with all methods |
1648 | 172 |
declared by this class." |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
173 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
174 |
^ self subclassResponsibility |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
175 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
176 |
"Created: / 01-08-2012 / 11:07:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1648 | 177 |
! |
178 |
||
179 |
getGenericSignature |
|
180 |
"Returns Java generic signature (if a generic class) or nil" |
|
181 |
||
182 |
^nil |
|
183 |
||
184 |
"Created: / 22-08-2012 / 11:57:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
185 |
! |
|
186 |
||
187 |
getInterfaces |
|
188 |
"Return a list if interfaces" |
|
189 |
||
190 |
^self subclassResponsibility |
|
191 |
||
192 |
"Created: / 22-08-2012 / 11:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
193 |
! |
|
194 |
||
195 |
getModifiers |
|
196 |
"Return class modifiers (public/abstract/final...)" |
|
197 |
||
198 |
^self subclassResponsibility |
|
199 |
||
200 |
"Created: / 22-08-2012 / 10:49:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
201 |
! |
|
202 |
||
203 |
getName |
|
204 |
"Returns name of the class" |
|
205 |
^klass javaName |
|
206 |
||
207 |
"Created: / 22-08-2012 / 10:46:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
208 |
! |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
209 |
|
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
210 |
getProtectionDomain |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
211 |
^nil |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
212 |
|
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
213 |
"Created: / 22-08-2012 / 12:56:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
214 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
215 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
216 |
!JavaMirror methodsFor:'initialization'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
217 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
218 |
setKlass: aClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
219 |
klass := aClass. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
220 |
reflection := JavaVM reflection |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
221 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
222 |
"Created: / 31-07-2012 / 17:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
223 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
224 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
225 |
!JavaMirror methodsFor:'instance creation-java.lang.reflect.*'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
226 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
227 |
create: ctorOrMethodClass for: class method: method signature: signature modifiers: modifiers parameterTyoes: parameterClasses exceptionTypes: exceptionClasses annotations: annotations |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
228 |
"Creates a new java.lang.Constructor. Arguments: |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
229 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
230 |
ctorOrMethodClass <java.lang.reflect.Constructor|java.lang.reflect.Method> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
231 |
class <Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
232 |
method <Method> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
233 |
signature <String> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
234 |
modifiers <SmallInteger> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
235 |
parameterClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
236 |
exceptionClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
237 |
annotations <JavaAnnotationContainer> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
238 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
239 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
240 |
| ctorOrMethod | |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
241 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
242 |
ctorOrMethod := ctorOrMethodClass new. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
243 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
244 |
ctorOrMethod |
1677 | 245 |
instVarNamed: #clazz put: (reflection javaClassObjectForClass: "method m"class); |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
246 |
instVarNamed: #slot put: method; |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
247 |
instVarNamed: #modifiers put: modifiers; |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
248 |
instVarNamed: #parameterTypes |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
249 |
put: (reflection javaClassObjectArrayForClasses: parameterClasses); |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
250 |
instVarNamed: #exceptionTypes |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
251 |
put: (reflection javaClassObjectArrayForClasses: exceptionClasses); |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
252 |
instVarNamed: #annotations put: annotations runtimeVisible bytes; |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
253 |
breakPoint: #mh info: 'Please, replace ??? by code that accesses parameterAnnotations byte array'. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
254 |
"/ Look at java.lang.reflect.Method/Constructor to figure out what value is needed here." |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
255 |
"/ Also, make sure there is a test in libjava tests (stx.libjava.tests.lang.XXXX, if not, |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
256 |
"/ add some!!!!!! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
257 |
"/instVarNamed: #parameterAnnotations put: annotations ???; |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
258 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
259 |
|
1648 | 260 |
(method isJavaMethod and:[method signature notNil]) ifTrue:[ |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
261 |
ctorOrMethod |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
262 |
instVarNamed: #signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
263 |
put: (reflection javaStringObjectForString: method signature interned: true) |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
264 |
]. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
265 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
266 |
^ ctorOrMethod |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
267 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
268 |
"Created: / 01-08-2012 / 10:24:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
269 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
270 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
271 |
createConstructorFor: class method: method signature: signature modifiers: modifiers parameterTyoes: parameterClasses exceptionTypes: exceptionClasses annotations: annotations |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
272 |
"Creates a new java.lang.Constructor. Arguments: |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
273 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
274 |
class <Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
275 |
method <Method> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
276 |
signature <String> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
277 |
modifiers <SmallInteger> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
278 |
parameterClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
279 |
exceptionClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
280 |
annotations <JavaAnnotationContainer> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
281 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
282 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
283 |
| ctor | |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
284 |
ctor := self create: (JavaVM classForName:'java.lang.reflect.Constructor') |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
285 |
for: class |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
286 |
method: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
287 |
signature: signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
288 |
modifiers: modifiers |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
289 |
parameterTyoes: parameterClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
290 |
exceptionTypes: exceptionClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
291 |
annotations: annotations. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
292 |
^ctor |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
293 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
294 |
"Created: / 01-08-2012 / 10:20:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
295 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
296 |
|
1648 | 297 |
createFieldFor: javaField |
298 |
"given a java field, return the corresponding java.lang.Field |
|
299 |
instance for it." |
|
300 |
" |
|
301 |
See OpenJDK7 source: |
|
302 |
jdk7/hotspot/src/share/vm/runtime/reflection.cpp, |
|
303 |
oop Reflection::new_field" |
|
304 |
||
305 |
| field clazz name slot type modifiers | |
|
306 |
||
307 |
clazz := reflection javaClassObjectForClass: klass. |
|
308 |
name := JavaVM reflection javaStringObjectForString: javaField name |
|
309 |
interned: true. |
|
310 |
slot := javaField index. |
|
311 |
type := JavaVM javaClassObjectForClass: javaField typeClass. |
|
312 |
modifiers := javaField accessFlags. |
|
313 |
field := (JavaVM classForName: 'java.lang.reflect.Field') new. |
|
314 |
field |
|
315 |
instVarNamed: #clazz put: clazz; |
|
316 |
instVarNamed: #name put: name; |
|
317 |
instVarNamed: #slot put: slot; |
|
318 |
instVarNamed: #type put: type; |
|
319 |
instVarNamed: #modifiers put: modifiers; |
|
320 |
yourself. |
|
321 |
javaField annotations |
|
322 |
ifNotNil: [ |
|
323 |
field instVarNamed: #annotations |
|
324 |
put: javaField annotations runtimeVisible rawAnnotations |
|
325 |
]. |
|
326 |
^ field. |
|
327 |
||
328 |
"Created: / 22-08-2012 / 12:09:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
329 |
! |
|
330 |
||
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
331 |
createMethodFor: class method: method name: name signature: signature modifiers: modifiers parameterTyoes: parameterClasses returnType: returnClass exceptionTypes: exceptionClasses annotations: annotations |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
332 |
"Creates a new java.lang.Constructor. Arguments: |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
333 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
334 |
class <Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
335 |
method <Method> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
336 |
name <String> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
337 |
signature <String> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
338 |
modifiers <SmallInteger> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
339 |
parameterClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
340 |
returnClass <Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
341 |
exceptionClasses <Collection of Class> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
342 |
annotations <JavaAnnotationContainer> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
343 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
344 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
345 |
| mthd | |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
346 |
mthd := self create: (JavaVM classForName:'java.lang.reflect.Method') |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
347 |
for: class |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
348 |
method: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
349 |
signature: signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
350 |
modifiers: modifiers |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
351 |
parameterTyoes: parameterClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
352 |
exceptionTypes: exceptionClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
353 |
annotations: annotations. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
354 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
355 |
mthd |
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
356 |
instVarNamed: #name put: (reflection javaStringObjectForString: name interned: true); |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
357 |
instVarNamed: #returnType put: (reflection javaClassObjectForClass: returnClass); |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
358 |
instVarNamed: #annotationDefault put: (annotations default bytes). |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
359 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
360 |
^mthd |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
361 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
362 |
"Created: / 01-08-2012 / 10:46:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
363 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
364 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
365 |
!JavaMirror::AlienClassMirror class methodsFor:'documentation'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
366 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
367 |
documentation |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
368 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
369 |
Specialized mirror for Smalltalk (and all other |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
370 |
non-Java classes) |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
371 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
372 |
[author:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
373 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
374 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
375 |
[instance variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
376 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
377 |
[class variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
378 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
379 |
[see also:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
380 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
381 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
382 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
383 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
384 |
!JavaMirror::AlienClassMirror methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
385 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
386 |
getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
387 |
"Returns a class loader that loaded this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
388 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
389 |
^ (Java classForName:'stx.libjava.ClassLoader') instVarNamed: #scl. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
390 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
391 |
"Modified: / 31-07-2012 / 18:34:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
392 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
393 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
394 |
getDeclaredConstructors:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
395 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
396 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
397 |
|
1648 | 398 |
"Here, return onlu default constructor. Later, all methods annotated |
399 |
with <jsignature: #'<init>(...)V'> wil be returned as well" |
|
400 |
||
401 |
| ctors | |
|
402 |
||
403 |
ctors := OrderedCollection new. |
|
404 |
klass selectorsAndMethodsDo:[:sel :mthd| |
|
405 |
(self isJavaConstructor: mthd selector: sel) ifTrue:[ |
|
406 |
ctors add: (self getDeclaredConstructorFor: mthd). |
|
407 |
]. |
|
408 |
]. |
|
409 |
||
410 |
ctors isEmpty ifTrue:[ |
|
411 |
"/If no constructor is found, fake default one... |
|
412 |
ctors add: (self getDeclaredConstructorFor: (klass lookupMethodFor: #initialize)). |
|
413 |
]. |
|
414 |
||
415 |
^(JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass withAll: ctors |
|
416 |
||
417 |
"Modified: / 22-08-2012 / 11:37:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
418 |
! |
|
419 |
||
420 |
getDeclaredFields:publicOnly |
|
421 |
"Returns an java.lang.reflect.Field[] with all constructors |
|
422 |
declared by this class." |
|
423 |
||
424 |
| fields | |
|
425 |
||
426 |
fields := OrderedCollection new. |
|
427 |
||
428 |
klass instVarNames withIndexDo:[:nm :index| |
|
429 |
| field | |
|
430 |
||
431 |
field := JavaField new. |
|
432 |
field |
|
433 |
setAccessFlags: JavaConstants ACC_PROTECTED; |
|
434 |
setClass: klass; |
|
435 |
setIndex: klass superclass instSize + index; |
|
436 |
setDescriptor: #'Ljava/lang/Object;'; |
|
437 |
setName: nm. |
|
438 |
||
439 |
fields add: (self createFieldFor: field) |
|
440 |
]. |
|
441 |
||
442 |
^ (JavaVM classForName:'java.lang.reflect.Field') javaArrayClass |
|
443 |
withAll:fields |
|
444 |
||
445 |
"Modified: / 22-08-2012 / 12:19:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
446 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
447 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
448 |
getDeclaredMethods:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
449 |
"Returns an java.lang.reflect.Method[] with all methods |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
450 |
declared by this class" |
1648 | 451 |
|
452 |
| methods | |
|
453 |
||
454 |
methods := OrderedCollection new. |
|
455 |
klass selectorsAndMethodsDo:[:sel :mthd| |
|
456 |
(self isJavaMethod: mthd selector: sel) ifTrue:[ |
|
457 |
methods add: (self getDeclaredMethodFor: mthd). |
|
458 |
]. |
|
459 |
]. |
|
460 |
^(JavaVM classForName:'java.lang.reflect.Method') javaArrayClass withAll: methods |
|
461 |
||
462 |
"Modified: / 22-08-2012 / 11:36:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
463 |
! |
|
464 |
||
465 |
getInterfaces |
|
466 |
"Return a list if interfaces" |
|
467 |
||
468 |
^ Array with: (JavaVM classForName: 'java.lang.Cloneable') |
|
469 |
||
470 |
"Modified: / 22-08-2012 / 11:06:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
471 |
! |
|
472 |
||
473 |
getModifiers |
|
474 |
"Return class modifiers (public/abstract/final...)" |
|
475 |
||
476 |
^ JavaConstants ACC_PUBLIC |
|
477 |
||
478 |
"Modified: / 22-08-2012 / 11:01:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
479 |
! |
|
480 |
||
481 |
getName |
|
482 |
"Returns name of the class" |
|
483 |
^'SMALLTALK.' , klass name |
|
484 |
||
485 |
"Created: / 22-08-2012 / 10:47:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
486 |
! ! |
|
487 |
||
488 |
!JavaMirror::AlienClassMirror methodsFor:'accessing-private'! |
|
489 |
||
490 |
getDeclaredConstructorFor: method |
|
491 |
^ self |
|
492 |
createConstructorFor: klass |
|
493 |
method: method |
|
494 |
signature: (self getSignatureForConstructor: method) |
|
495 |
modifiers: JavaConstants ACC_PUBLIC |
|
496 |
parameterTyoes: #() |
|
497 |
exceptionTypes: #() |
|
498 |
annotations: JavaMethodAnnotationContainer new |
|
499 |
||
500 |
"Created: / 22-08-2012 / 11:36:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
501 |
! |
|
502 |
||
503 |
getDeclaredMethodFor:method |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
504 |
| signature name java_lang_Object | |
1648 | 505 |
|
506 |
signature := self getSignatureForMethod: method short: false. |
|
507 |
name := signature upTo: $(. |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
508 |
java_lang_Object := JavaVM classNamed: 'java.lang.Object'. |
1648 | 509 |
^ self |
510 |
createMethodFor: klass |
|
511 |
method: method |
|
512 |
name: name |
|
513 |
signature: signature |
|
514 |
modifiers: JavaConstants ACC_PUBLIC |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
515 |
parameterTyoes: ((1 to: method selector numArgs) collect:[:i|java_lang_Object]) |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
516 |
returnType: java_lang_Object |
1648 | 517 |
exceptionTypes: #() |
518 |
annotations: JavaMethodAnnotationContainer new |
|
519 |
||
520 |
"Created: / 22-08-2012 / 11:36:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
521 |
! |
|
522 |
||
523 |
getSignatureForConstructor: method |
|
524 |
| signature | |
|
525 |
||
526 |
signature := |
|
527 |
(String streamContents:[:s| |
|
528 |
s nextPutAll: '<init>('. |
|
529 |
method selector numArgs timesRepeat:[ |
|
530 |
s nextPutAll:'Ljava/lang/Object;'. |
|
531 |
]. |
|
532 |
s nextPutAll: ')V'. |
|
533 |
]) asSymbol. |
|
534 |
^signature |
|
535 |
||
536 |
"Created: / 22-08-2012 / 11:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
537 |
! |
|
538 |
||
539 |
getSignatureForMethod: method short: short |
|
540 |
| selector signature | |
|
541 |
||
542 |
selector := method selector. |
|
543 |
signature := |
|
544 |
(String streamContents:[:s| |
|
545 |
short ifTrue:[ |
|
546 |
s nextPutAll: (selector upTo: $:) |
|
547 |
] ifFalse:[ |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
548 |
selector numArgs == 1 ifTrue:[ |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
549 |
s nextPutAll: (selector copyTo: selector size - 1) |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
550 |
] ifFalse:[ |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
551 |
s nextPutAll: (selector copyReplaceAll: $: with: $_) |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
552 |
] |
1648 | 553 |
]. |
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
554 |
s nextPut: $(. |
1648 | 555 |
method selector numArgs timesRepeat:[ |
556 |
s nextPutAll:'Ljava/lang/Object;'. |
|
557 |
]. |
|
558 |
s nextPutAll: ')'. |
|
559 |
s nextPutAll:'Ljava/lang/Object;'. |
|
560 |
]) asSymbol. |
|
561 |
^signature |
|
562 |
||
563 |
"Created: / 22-08-2012 / 11:46:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
564 |
! ! |
|
565 |
||
566 |
!JavaMirror::AlienClassMirror methodsFor:'testing-private'! |
|
567 |
||
568 |
isJavaConstructor: mthd selector: sel |
|
569 |
||
570 |
^sel startsWith: #initialize |
|
571 |
||
572 |
"Created: / 22-08-2012 / 11:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
573 |
! |
|
574 |
||
575 |
isJavaMethod: mthd selector: sel |
|
576 |
||
577 |
^sel isBinarySelector not |
|
578 |
and:[(self isJavaConstructor: mthd selector: sel) not] |
|
579 |
||
580 |
"Created: / 22-08-2012 / 11:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
581 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
582 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
583 |
!JavaMirror::JavaArrayMirror methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
584 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
585 |
getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
586 |
"Returns a class loader that loaded this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
587 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
588 |
^ klass javaComponentClass javaMirror getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
589 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
590 |
"Modified: / 31-07-2012 / 18:35:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
591 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
592 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
593 |
getDeclaredConstructors:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
594 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
595 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
596 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
597 |
^ (JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass new:0. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
598 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
599 |
"Modified: / 31-07-2012 / 18:41:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
600 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
601 |
|
1648 | 602 |
getDeclaredFields:publicOnly |
603 |
"Returns an java.lang.reflect.Field[] with all constructors |
|
604 |
declared by this class." |
|
605 |
||
606 |
^(JavaVM classForName:'java.lang.reflect.Field') javaArrayClass new:0. |
|
607 |
||
608 |
"Modified: / 22-08-2012 / 12:03:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
609 |
! |
|
610 |
||
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
611 |
getDeclaredMethods:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
612 |
"Returns an java.lang.reflect.Method[] with all methods |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
613 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
614 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
615 |
^ (JavaVM classForName:'java.lang.reflect.Method') javaArrayClass new:0. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
616 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
617 |
"Modified: / 01-08-2012 / 11:08:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1648 | 618 |
! |
619 |
||
620 |
getInterfaces |
|
621 |
"Return a list if interfaces" |
|
622 |
||
623 |
^ Array |
|
624 |
with: (JavaVM classForName: 'java.lang.Cloneable') |
|
625 |
with: (JavaVM classForName: 'java.io.Serializable') |
|
626 |
||
627 |
"Modified: / 22-08-2012 / 11:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
628 |
! |
|
629 |
||
630 |
getModifiers |
|
631 |
"Return class modifiers (public/abstract/final...)" |
|
632 |
||
633 |
^ JavaConstants ACC_ABSTRACT | JavaConstants ACC_FINAL | JavaConstants ACC_PUBLIC |
|
634 |
||
635 |
"Modified: / 22-08-2012 / 11:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
636 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
637 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
638 |
!JavaMirror::JavaClassMirror class methodsFor:'documentation'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
639 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
640 |
documentation |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
641 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
642 |
A specialized mirror for all Java classes |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
643 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
644 |
[author:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
645 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
646 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
647 |
[instance variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
648 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
649 |
[class variables:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
650 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
651 |
[see also:] |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
652 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
653 |
" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
654 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
655 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
656 |
!JavaMirror::JavaClassMirror methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
657 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
658 |
getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
659 |
"Returns a class loader that loaded this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
660 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
661 |
^ klass classLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
662 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
663 |
"Modified: / 31-07-2012 / 18:26:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
664 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
665 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
666 |
getDeclaredConstructors:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
667 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
668 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
669 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
670 |
| ctors | |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
671 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
672 |
ctors := OrderedCollection new. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
673 |
klass selectorsAndMethodsDo:[:sel :mthd| |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
674 |
(mthd isJavaConstructor and:[publicOnly not or:[mthd isPublic]]) ifTrue:[ |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
675 |
ctors add: (self getDeclaredConstructorFor: mthd). |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
676 |
]. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
677 |
]. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
678 |
^(JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass withAll: ctors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
679 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
680 |
"Modified: / 01-08-2012 / 11:04:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
681 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
682 |
|
1648 | 683 |
getDeclaredFields:publicOnly |
684 |
"Returns an java.lang.reflect.Field[] with all constructors |
|
685 |
declared by this class." |
|
686 |
||
687 |
| fields | |
|
688 |
||
689 |
fields := klass fields , klass staticFields. |
|
690 |
publicOnly ifTrue:[ fields := fields select:[:f | f isPublic ] ]. |
|
691 |
JavaClassReader classLoaderQuerySignal answer: klass classLoader do:[ |
|
692 |
fields := fields collect:[:f | self createFieldFor:f ]. |
|
693 |
]. |
|
694 |
^ (JavaVM classForName:'java.lang.reflect.Field') javaArrayClass |
|
695 |
withAll:fields |
|
696 |
||
697 |
"Modified: / 22-08-2012 / 12:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
698 |
! |
|
699 |
||
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
700 |
getDeclaredMethods:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
701 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
702 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
703 |
|
1648 | 704 |
| methods | |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
705 |
|
1648 | 706 |
methods := OrderedCollection new. |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
707 |
klass selectorsAndMethodsDo:[:sel :mthd| |
1699
73003b9f58fc
- Support for extension methods finished (ready for testing)
vranyj1
parents:
1677
diff
changeset
|
708 |
mthd isJavaMethod and:[ |
1708 | 709 |
(mthd isJavaConstructor not |
710 |
and:[mthd isJavaStaticInitializer not |
|
711 |
and:[publicOnly not or:[mthd isPublic]]]) ifTrue:[ |
|
1699
73003b9f58fc
- Support for extension methods finished (ready for testing)
vranyj1
parents:
1677
diff
changeset
|
712 |
methods add: (self getDeclaredMethodFor: mthd). |
73003b9f58fc
- Support for extension methods finished (ready for testing)
vranyj1
parents:
1677
diff
changeset
|
713 |
] |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
714 |
]. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
715 |
]. |
1648 | 716 |
^(JavaVM classForName:'java.lang.reflect.Method') javaArrayClass withAll: methods |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
717 |
|
1708 | 718 |
"Modified: / 19-09-2012 / 16:26:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1648 | 719 |
! |
720 |
||
721 |
getGenericSignature |
|
722 |
"Returns Java generic signature (if a generic class) or nil" |
|
723 |
||
724 |
^klass signatureJ |
|
725 |
||
726 |
"Created: / 22-08-2012 / 11:58:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
727 |
! |
|
728 |
||
729 |
getInterfaces |
|
730 |
"Return a list if interfaces" |
|
731 |
||
732 |
^ klass interfaces |
|
733 |
||
734 |
"Modified: / 22-08-2012 / 11:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
735 |
! |
|
736 |
||
737 |
getModifiers |
|
738 |
"Return class modifiers (public/abstract/final...)" |
|
739 |
||
740 |
| modifiers | |
|
741 |
||
742 |
"According to OpenJDK JVM, strip ACC_SUPER" |
|
743 |
modifiers := (klass accessFlags & JavaConstants ACC_SUPER bitInvert) & 16r7FFF. |
|
744 |
"JV@2011-10-30: It seems that private inner classes has no |
|
745 |
private bit set, sigh" |
|
746 |
(modifiers & 16r0007) == 0 ifTrue:[ |
|
747 |
modifiers := modifiers | JavaConstants ACC_PRIVATE. |
|
748 |
]. |
|
749 |
^modifiers |
|
750 |
||
751 |
"Modified: / 22-08-2012 / 11:03:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1649
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
752 |
! |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
753 |
|
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
754 |
getProtectionDomain |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
755 |
^klass protectionDomain |
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
756 |
|
0af82006c0b2
- some more support for calling Smalltalk from Groovy. Crashes VM now :-)
vranyj1
parents:
1648
diff
changeset
|
757 |
"Created: / 22-08-2012 / 12:56:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
758 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
759 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
760 |
!JavaMirror::JavaClassMirror methodsFor:'accessing-private'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
761 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
762 |
getDeclaredConstructorFor: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
763 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
764 |
^self createConstructorFor: method javaClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
765 |
method: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
766 |
signature: method signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
767 |
modifiers: method accessFlags |
1609
7a2627788ad7
- JavaMirror: fixed method/constructor reflection for classes loaded by other than system/primordial classloader.
vranyj1
parents:
1581
diff
changeset
|
768 |
parameterTyoes: (method descriptor parameterClassesUsingClassLoader: method javaClass classLoader) |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
769 |
exceptionTypes: method exceptionClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
770 |
annotations: method method annotations. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
771 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
772 |
"Created: / 01-08-2012 / 00:46:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
773 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
774 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
775 |
getDeclaredMethodFor: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
776 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
777 |
^self createMethodFor: method javaClass |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
778 |
method: method |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
779 |
name: (method selector upTo: $() |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
780 |
signature: method signature |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
781 |
modifiers: method accessFlags |
1609
7a2627788ad7
- JavaMirror: fixed method/constructor reflection for classes loaded by other than system/primordial classloader.
vranyj1
parents:
1581
diff
changeset
|
782 |
parameterTyoes: (method descriptor parameterClassesUsingClassLoader: method javaClass classLoader) |
7a2627788ad7
- JavaMirror: fixed method/constructor reflection for classes loaded by other than system/primordial classloader.
vranyj1
parents:
1581
diff
changeset
|
783 |
returnType: (method descriptor returnClassUsingClassLoader: method javaClass classLoader) |
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
784 |
exceptionTypes: method exceptionClasses |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
785 |
annotations: method method annotations. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
786 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
787 |
"Created: / 01-08-2012 / 11:11:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
788 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
789 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
790 |
!JavaMirror::JavaPrimitiveMirror methodsFor:'accessing'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
791 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
792 |
getClassLoader |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
793 |
"Returns a class loader that loaded this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
794 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
795 |
^ nil |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
796 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
797 |
"Modified: / 31-07-2012 / 18:35:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
798 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
799 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
800 |
getDeclaredConstructors:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
801 |
"Returns an java.lang.reflect.Constructor[] with all constructors |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
802 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
803 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
804 |
^ (JavaVM classForName:'java.lang.reflect.Constructor') javaArrayClass new:0. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
805 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
806 |
"Modified: / 31-07-2012 / 18:41:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
807 |
! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
808 |
|
1648 | 809 |
getDeclaredFields:publicOnly |
810 |
"Returns an java.lang.reflect.Field[] with all constructors |
|
811 |
declared by this class." |
|
812 |
||
813 |
^(JavaVM classForName:'java.lang.reflect.Field') javaArrayClass new:0. |
|
814 |
||
815 |
"Modified: / 22-08-2012 / 12:03:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
816 |
! |
|
817 |
||
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
818 |
getDeclaredMethods:publicOnly |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
819 |
"Returns an java.lang.reflect.Method[] with all methods |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
820 |
declared by this class" |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
821 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
822 |
^ (JavaVM classForName:'java.lang.reflect.Method') javaArrayClass new:0. |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
823 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
824 |
"Modified: / 01-08-2012 / 11:08:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1648 | 825 |
! |
826 |
||
827 |
getInterfaces |
|
828 |
"Return a list if interfaces" |
|
829 |
||
830 |
^ #() |
|
831 |
||
832 |
"Modified: / 22-08-2012 / 11:07:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
833 |
! |
|
834 |
||
835 |
getModifiers |
|
836 |
"Return class modifiers (public/abstract/final...)" |
|
837 |
||
838 |
^ JavaConstants ACC_ABSTRACT | JavaConstants ACC_FINAL | JavaConstants ACC_PUBLIC |
|
839 |
||
840 |
"Modified: / 22-08-2012 / 11:02:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1581
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
841 |
! ! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
842 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
843 |
!JavaMirror class methodsFor:'documentation'! |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
844 |
|
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
845 |
version_SVN |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
846 |
^ '$Id:: $' |
70fbc03d2d82
Java reflection support refactoring - moved to use JavaMirrors
vranyj1
parents:
diff
changeset
|
847 |
! ! |