author | kursjan |
Mon, 12 Dec 2011 17:15:20 +0000 | |
branch | jk_new_structure |
changeset 1271 | 2caa288596fd |
parent 1227 | 5b7722ac31a4 |
child 1281 | b46adbe75503 |
permissions | -rw-r--r-- |
877 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 3 |
|
1155 | 4 |
New code and modifications done at SWING Research Group [1]: |
1152 | 5 |
|
877 | 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 |
||
1155 | 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 |
|
1152 | 19 |
as of 1.9.2010 |
877 | 20 |
" |
752 | 21 |
"{ Package: 'stx:libjava' }" |
22 |
||
23 |
JavaDescriptor subclass:#JavaFieldDescriptor |
|
24 |
instanceVariableNames:'javaClassName javaClass' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Support' |
|
28 |
! |
|
29 |
||
877 | 30 |
!JavaFieldDescriptor class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
1152 | 35 |
|
1155 | 36 |
New code and modifications done at SWING Research Group [1]: |
1152 | 37 |
|
877 | 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 |
||
1155 | 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 |
|
1152 | 51 |
as of 1.9.2010 |
877 | 52 |
|
53 |
" |
|
54 |
! ! |
|
752 | 55 |
|
56 |
!JavaFieldDescriptor class methodsFor:'instance creation'! |
|
57 |
||
58 |
javaClass: cls |
|
59 |
||
60 |
^self new javaClass: cls |
|
61 |
||
62 |
"Created: / 25-11-2010 / 18:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
63 |
! |
|
64 |
||
65 |
javaClassName: clsName |
|
66 |
||
67 |
^self new javaClassName: clsName |
|
68 |
||
69 |
"Created: / 25-11-2010 / 18:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
70 |
! ! |
|
71 |
||
72 |
!JavaFieldDescriptor methodsFor:'accessing'! |
|
73 |
||
74 |
javaClass |
|
1033 | 75 |
javaClass ifNil: [ javaClass := JavaVM classForName: self javaClassName ]. |
76 |
^ javaClass |
|
752 | 77 |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
78 |
"Modified: / 13-08-2011 / 01:24:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 79 |
! |
80 |
||
81 |
javaClassName |
|
912
e651488f5741
Many fixes in reflection, expecially for generic types support
vranyj1
parents:
877
diff
changeset
|
82 |
|
1159 | 83 |
javaClassName notNil ifTrue:[ |
1227 | 84 |
^ javaClassName |
1159 | 85 |
]. |
86 |
javaClass notNil ifTrue:[ |
|
1227 | 87 |
^ javaClass javaName |
1159 | 88 |
]. |
89 |
||
90 |
self error:'javaClassName nor javaClass set' |
|
91 |
||
1227 | 92 |
"Modified: / 06-12-2011 / 21:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
752 | 93 |
! |
94 |
||
95 |
javaClassObject |
|
96 |
||
97 |
^JavaVM javaClassObjectForClass: self javaClass |
|
98 |
||
99 |
"Created: / 25-11-2010 / 18:10:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
100 |
! ! |
|
101 |
||
1227 | 102 |
!JavaFieldDescriptor methodsFor:'comparing'! |
103 |
||
104 |
= another |
|
105 |
||
106 |
^ self class == another class |
|
107 |
and:[ self javaClass = another javaClass ] |
|
108 |
||
109 |
"Created: / 06-12-2011 / 22:43:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
110 |
! |
|
111 |
||
112 |
hash |
|
113 |
||
114 |
^self javaClass hash |
|
115 |
||
116 |
"Created: / 06-12-2011 / 22:43:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
117 |
! |
|
118 |
||
119 |
match: another |
|
1271 | 120 |
self javaClass isJavaPrimitiveType ifTrue: [ |
121 |
^JavaVM canCast: self javaClass to: another javaClass |
|
122 |
]. |
|
123 |
"/ I have no idea, if some object may match another Smalltalk object, so be generous |
|
124 |
^ true. |
|
1227 | 125 |
|
126 |
"Created: / 06-12-2011 / 22:56:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1271 | 127 |
"Modified: / 12-12-2011 / 17:58:07 / kursjan <kursjan@fit.cvut.cz>" |
1227 | 128 |
! ! |
129 |
||
752 | 130 |
!JavaFieldDescriptor methodsFor:'initialization'! |
131 |
||
1227 | 132 |
javaClass:aJavaClass |
133 |
javaClass := aJavaClass. |
|
752 | 134 |
! |
135 |
||
1227 | 136 |
javaClassName:aString |
137 |
javaClassName := aString upTo: $<. |
|
138 |
||
139 |
"Modified: / 06-12-2011 / 21:41:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
752 | 140 |
! ! |
141 |
||
142 |
!JavaFieldDescriptor class methodsFor:'documentation'! |
|
143 |
||
144 |
version_SVN |
|
145 |
^ '$Id$' |
|
146 |
! ! |