1390
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
|
|
4 |
New code and modifications done at SWING Research Group [1]:
|
|
5 |
|
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
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 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
|
19 |
as of 1.9.2010
|
|
20 |
"
|
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
Object subclass:#JavaClassAccessor
|
1430
|
24 |
instanceVariableNames:'name fullName package loading'
|
1390
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Classes'
|
|
28 |
!
|
|
29 |
|
|
30 |
!JavaClassAccessor class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
35 |
|
|
36 |
New code and modifications done at SWING Research Group [1]:
|
|
37 |
|
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
|
41 |
This software is furnished under a license and may be used
|
|
42 |
only in accordance with the terms of that license and with the
|
|
43 |
inclusion of the above copyright notice. This software may not
|
|
44 |
be provided or otherwise made available to, or used by, any
|
|
45 |
other person. No title to or ownership of the software is
|
|
46 |
hereby transferred.
|
|
47 |
|
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
|
51 |
as of 1.9.2010
|
|
52 |
|
|
53 |
"
|
|
54 |
! !
|
|
55 |
|
|
56 |
!JavaClassAccessor class methodsFor:'instance creation'!
|
|
57 |
|
|
58 |
fullName: aSymbol
|
|
59 |
|
|
60 |
^self new setFullName: aSymbol
|
|
61 |
|
|
62 |
"Created: / 28-02-2012 / 19:20:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
63 |
! !
|
|
64 |
|
|
65 |
!JavaClassAccessor methodsFor:'accessing'!
|
|
66 |
|
|
67 |
fullName
|
|
68 |
^ fullName
|
|
69 |
!
|
|
70 |
|
|
71 |
name
|
|
72 |
"Returns Smalltalk name"
|
|
73 |
^name
|
|
74 |
|
|
75 |
"Created: / 28-02-2012 / 19:48:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
76 |
!
|
|
77 |
|
|
78 |
theClass
|
|
79 |
| cls |
|
|
80 |
|
|
81 |
cls := self theClassOrNil.
|
1430
|
82 |
cls isNil ifTrue:[
|
|
83 |
[
|
|
84 |
loading := true.
|
|
85 |
cls := Java classForName: (fullName copyReplaceAll: $/ with: $.)
|
|
86 |
] ensure:[
|
|
87 |
loading := false
|
|
88 |
].
|
|
89 |
].
|
1390
|
90 |
^cls
|
|
91 |
|
|
92 |
"Created: / 28-02-2012 / 19:22:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
93 |
!
|
|
94 |
|
|
95 |
theClassOrNil
|
|
96 |
^JavaVM registry classNamed: fullName.
|
|
97 |
|
|
98 |
"Created: / 28-02-2012 / 19:47:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
99 |
! !
|
|
100 |
|
|
101 |
!JavaClassAccessor methodsFor:'error handling'!
|
|
102 |
|
|
103 |
doesNotUnderstand: aMessage
|
|
104 |
|
|
105 |
^aMessage sendTo: self theClass
|
|
106 |
|
|
107 |
"Created: / 28-02-2012 / 19:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
108 |
! !
|
|
109 |
|
|
110 |
!JavaClassAccessor methodsFor:'initialization'!
|
|
111 |
|
|
112 |
setFullName: aSymbol
|
|
113 |
fullName := aSymbol.
|
|
114 |
name := 'JAVA::' , ((fullName tokensBasedOn: $/) asStringWith: '::')
|
|
115 |
|
|
116 |
"Created: / 28-02-2012 / 19:21:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
117 |
! !
|
|
118 |
|
|
119 |
!JavaClassAccessor methodsFor:'instance creation'!
|
|
120 |
|
|
121 |
new
|
|
122 |
|
|
123 |
^self theClass new
|
|
124 |
|
|
125 |
"Created: / 28-02-2012 / 19:34:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
126 |
!
|
|
127 |
|
|
128 |
newCleared
|
|
129 |
|
|
130 |
^self theClass newCleared
|
|
131 |
|
|
132 |
"Created: / 28-02-2012 / 19:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
133 |
! !
|
|
134 |
|
|
135 |
!JavaClassAccessor methodsFor:'printing & storing'!
|
|
136 |
|
|
137 |
printOn:aStream
|
|
138 |
aStream nextPutAll: 'JAVA '.
|
|
139 |
(fullName tokensBasedOn: $/)
|
|
140 |
do:[:component|aStream nextPutAll: component]
|
|
141 |
separatedBy:[aStream space].
|
|
142 |
|
|
143 |
"Modified: / 28-02-2012 / 20:27:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
144 |
! !
|
|
145 |
|
|
146 |
!JavaClassAccessor methodsFor:'testing'!
|
|
147 |
|
|
148 |
isBehavior
|
|
149 |
|
|
150 |
^true
|
|
151 |
|
|
152 |
"Created: / 28-02-2012 / 19:36:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
153 |
!
|
|
154 |
|
|
155 |
isClass
|
|
156 |
|
|
157 |
^true
|
|
158 |
|
|
159 |
"Created: / 28-02-2012 / 20:00:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
160 |
!
|
|
161 |
|
|
162 |
isJavaClass
|
|
163 |
|
|
164 |
^true
|
|
165 |
|
|
166 |
"Created: / 28-02-2012 / 20:08:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1430
|
167 |
!
|
|
168 |
|
|
169 |
isLoaded
|
|
170 |
|
|
171 |
loading ifTrue:[ ^ false ].
|
|
172 |
self theClass. "/Force load"
|
|
173 |
^true
|
|
174 |
|
|
175 |
"Created: / 19-03-2012 / 10:44:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1390
|
176 |
! !
|
|
177 |
|
|
178 |
!JavaClassAccessor class methodsFor:'documentation'!
|
|
179 |
|
|
180 |
version_SVN
|
|
181 |
^ '$Id$'
|
|
182 |
! !
|