749
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
4 |
SWING Research Group, Czech Technical University in Prague
|
|
5 |
|
|
6 |
Parts of the code written by Claus Gittinger are under following
|
|
7 |
license:
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
17 |
|
|
18 |
Permission is hereby granted, free of charge, to any person
|
|
19 |
obtaining a copy of this software and associated documentation
|
|
20 |
files (the 'Software'), to deal in the Software without
|
|
21 |
restriction, including without limitation the rights to use,
|
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23 |
copies of the Software, and to permit persons to whom the
|
|
24 |
Software is furnished to do so, subject to the following
|
|
25 |
conditions:
|
|
26 |
|
|
27 |
The above copyright notice and this permission notice shall be
|
|
28 |
included in all copies or substantial portions of the Software.
|
|
29 |
|
|
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
38 |
|
|
39 |
[1] Code written at SWING Research Group contain a signature
|
|
40 |
of one of the above copright owners.
|
|
41 |
"
|
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
|
44 |
JavaRef2 subclass:#JavaClassContentRef2
|
|
45 |
instanceVariableNames:'classRefIndex nameAndTypeIndex classCache nameAndTypeCache'
|
|
46 |
classVariableNames:''
|
|
47 |
poolDictionaries:''
|
|
48 |
category:'Languages-Java-Reader-Support-new'
|
|
49 |
!
|
|
50 |
|
|
51 |
!JavaClassContentRef2 class methodsFor:'documentation'!
|
|
52 |
|
|
53 |
copyright
|
|
54 |
"
|
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
57 |
SWING Research Group, Czech Technical University in Prague
|
|
58 |
|
|
59 |
Parts of the code written by Claus Gittinger are under following
|
|
60 |
license:
|
|
61 |
|
|
62 |
This software is furnished under a license and may be used
|
|
63 |
only in accordance with the terms of that license and with the
|
|
64 |
inclusion of the above copyright notice. This software may not
|
|
65 |
be provided or otherwise made available to, or used by, any
|
|
66 |
other person. No title to or ownership of the software is
|
|
67 |
hereby transferred.
|
|
68 |
|
|
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
70 |
|
|
71 |
Permission is hereby granted, free of charge, to any person
|
|
72 |
obtaining a copy of this software and associated documentation
|
|
73 |
files (the 'Software'), to deal in the Software without
|
|
74 |
restriction, including without limitation the rights to use,
|
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76 |
copies of the Software, and to permit persons to whom the
|
|
77 |
Software is furnished to do so, subject to the following
|
|
78 |
conditions:
|
|
79 |
|
|
80 |
The above copyright notice and this permission notice shall be
|
|
81 |
included in all copies or substantial portions of the Software.
|
|
82 |
|
|
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
90 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
91 |
|
|
92 |
[1] Code written at SWING Research Group contain a signature
|
|
93 |
of one of the above copright owners.
|
|
94 |
|
|
95 |
"
|
|
96 |
! !
|
|
97 |
|
|
98 |
!JavaClassContentRef2 class methodsFor:'instance creation'!
|
|
99 |
|
|
100 |
in: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex
|
|
101 |
^ self basicNew
|
|
102 |
initializeIn: aJavaConstantPool
|
|
103 |
withNameAndTypeAt: nameAndTypeCPIndex
|
|
104 |
andClassAt: classRefCPIndex.
|
|
105 |
|
|
106 |
"Created: / 12-05-2011 / 18:36:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
107 |
! !
|
|
108 |
|
|
109 |
!JavaClassContentRef2 methodsFor:'accessing'!
|
|
110 |
|
|
111 |
classRef
|
|
112 |
^ constantPool at: classRefIndex.
|
|
113 |
|
|
114 |
"Modified: / 12-05-2011 / 18:38:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
115 |
!
|
|
116 |
|
|
117 |
descriptor
|
|
118 |
^ self nameAndType descriptor.
|
|
119 |
|
|
120 |
"Created: / 08-04-2011 / 15:08:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
121 |
"Modified: / 12-05-2011 / 18:39:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
122 |
!
|
|
123 |
|
|
124 |
name
|
|
125 |
^ self nameAndType name.
|
|
126 |
|
|
127 |
"Created: / 08-04-2011 / 13:54:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
128 |
"Modified: / 12-05-2011 / 18:39:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
129 |
!
|
|
130 |
|
|
131 |
nameAndType
|
|
132 |
^ constantPool at: nameAndTypeIndex.
|
|
133 |
|
|
134 |
"Created: / 11-04-2011 / 19:57:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
135 |
"Modified: / 12-05-2011 / 18:39:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
136 |
!
|
|
137 |
|
|
138 |
selector
|
|
139 |
^ self nameAndType selector.
|
|
140 |
|
|
141 |
"Created: / 11-04-2011 / 20:38:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
142 |
"Modified: / 12-05-2011 / 18:39:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
143 |
!
|
|
144 |
|
|
145 |
signature
|
|
146 |
^ self nameAndType signature.
|
|
147 |
|
|
148 |
"Created: / 20-05-2011 / 17:10:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
149 |
! !
|
|
150 |
|
|
151 |
!JavaClassContentRef2 methodsFor:'comparing'!
|
|
152 |
|
|
153 |
= anotherJavaRef
|
|
154 |
"superclass JavaRef2 says that I am responsible to implement this method"
|
|
155 |
|
|
156 |
^ self shouldImplement
|
|
157 |
!
|
|
158 |
|
|
159 |
hash
|
|
160 |
"superclass JavaRef2 says that I am responsible to implement this method"
|
|
161 |
|
|
162 |
^ self shouldImplement
|
|
163 |
! !
|
|
164 |
|
|
165 |
!JavaClassContentRef2 methodsFor:'initialization'!
|
|
166 |
|
|
167 |
initializeIn: aJavaConstantPool withNameAndTypeAt: nameAndTypeCPIndex andClassAt: classRefCPIndex
|
|
168 |
constantPool := aJavaConstantPool.
|
|
169 |
classRefIndex := classRefCPIndex.
|
|
170 |
nameAndTypeIndex := nameAndTypeCPIndex.
|
|
171 |
super initialize.
|
|
172 |
|
|
173 |
"Created: / 12-05-2011 / 18:37:10 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
174 |
! !
|
|
175 |
|
|
176 |
!JavaClassContentRef2 methodsFor:'printing'!
|
|
177 |
|
|
178 |
displayString
|
|
179 |
"superclass JavaRef2 says that I am responsible to implement this method"
|
|
180 |
|
|
181 |
^ self classRef displayString , '.' , self name
|
|
182 |
|
|
183 |
"Created: / 14-08-2011 / 21:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
184 |
!
|
|
185 |
|
|
186 |
printString
|
|
187 |
^ 'JavaClassContentRef: class=[' , self classRef printString , '] name=['
|
|
188 |
, self nameAndType printString , ']'.
|
|
189 |
|
|
190 |
"Created: / 10-05-2011 / 14:15:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
191 |
"Modified: / 12-05-2011 / 18:40:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
192 |
! !
|
|
193 |
|
|
194 |
!JavaClassContentRef2 methodsFor:'resolving'!
|
|
195 |
|
|
196 |
invalidate
|
|
197 |
self classRef invalidate.
|
|
198 |
classCache := nil.
|
|
199 |
nameAndTypeCache := nil.
|
|
200 |
super invalidate.
|
|
201 |
|
|
202 |
"Created: / 13-04-2011 / 12:21:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
203 |
"Modified: / 18-05-2011 / 12:41:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
204 |
!
|
|
205 |
|
|
206 |
invalidateForClass: internalJavaClassName
|
|
207 |
"Invalidate (means call invalidate) reference if it has something to do with given class (e.g Class named internalJavaClassName was unloaded).
|
|
208 |
Return true, if reference was invalidated."
|
|
209 |
|
|
210 |
(self classRef invalidateForClass: internalJavaClassName)
|
|
211 |
ifTrue:
|
|
212 |
[ self invalidate.
|
|
213 |
^ true ].
|
|
214 |
^ false.
|
|
215 |
|
|
216 |
"Modified: / 12-05-2011 / 18:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
217 |
! !
|
|
218 |
|
|
219 |
!JavaClassContentRef2 class methodsFor:'documentation'!
|
|
220 |
|
|
221 |
version_SVN
|
|
222 |
^ '$Id$'
|
|
223 |
! ! |