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 |
Object subclass:#JavaObjectDictionary
|
|
24 |
instanceVariableNames:'dictionary'
|
|
25 |
classVariableNames:'Instance'
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Support'
|
|
28 |
!
|
|
29 |
|
877
|
30 |
!JavaObjectDictionary 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 |
!JavaObjectDictionary class methodsFor:'instance creation'!
|
|
57 |
|
|
58 |
instance
|
|
59 |
Instance ifNil: [
|
|
60 |
Instance := self basicNew initialize.
|
|
61 |
].
|
|
62 |
^ Instance.
|
|
63 |
|
|
64 |
"Created: / 09-01-2011 / 20:48:16 / Jan Kurs <kurs.jan@post.cz>"
|
|
65 |
!
|
|
66 |
|
|
67 |
new
|
|
68 |
"Currently singleton but in future Query may be more suitable"
|
|
69 |
^ self instance.
|
|
70 |
|
|
71 |
"Created: / 09-01-2011 / 20:48:16 / Jan Kurs <kurs.jan@post.cz>"
|
|
72 |
! !
|
|
73 |
|
|
74 |
!JavaObjectDictionary methodsFor:'accessing'!
|
|
75 |
|
|
76 |
hasReflection: stClassName
|
|
77 |
"return true if stClassName has reflection in Java World"
|
|
78 |
^ (dictionary at: stClassName ifAbsent: [ nil ]) notNil
|
|
79 |
|
|
80 |
"Created: / 17-01-2011 / 19:20:58 / kursjan <kursjan@fit.cvut.cz>"
|
|
81 |
!
|
|
82 |
|
|
83 |
reflectionOf: stClassName
|
|
84 |
^ dictionary at: stClassName ifAbsent: [ NoReflectionObject new ]
|
|
85 |
|
|
86 |
"Created: / 09-01-2011 / 21:03:24 / Jan Kurs <kurs.jan@post.cz>"
|
|
87 |
"Modified: / 17-01-2011 / 10:39:43 / kursjan <kursjan@fit.cvut.cz>"
|
|
88 |
! !
|
|
89 |
|
|
90 |
!JavaObjectDictionary methodsFor:'adding & removing'!
|
|
91 |
|
|
92 |
flush
|
|
93 |
dictionary removeAll.
|
|
94 |
|
|
95 |
"Created: / 09-01-2011 / 21:44:04 / Jan Kurs <kurs.jan@post.cz>"
|
|
96 |
!
|
|
97 |
|
|
98 |
registerJavaObject: aJavaClass toStObject: aStObject
|
|
99 |
dictionary at: aStObject name asSymbol put: aJavaClass.
|
|
100 |
|
|
101 |
"Created: / 09-01-2011 / 21:40:00 / Jan Kurs <kurs.jan@post.cz>"
|
|
102 |
! !
|
|
103 |
|
|
104 |
!JavaObjectDictionary methodsFor:'initialization'!
|
|
105 |
|
|
106 |
initialize
|
|
107 |
"Use StCounter instead of Counter"
|
|
108 |
dictionary := IdentityDictionary new.
|
|
109 |
|
|
110 |
"Modified: / 09-01-2011 / 21:36:58 / Jan Kurs <kurs.jan@post.cz>"
|
|
111 |
! !
|
|
112 |
|
|
113 |
!JavaObjectDictionary class methodsFor:'documentation'!
|
|
114 |
|
|
115 |
version_SVN
|
|
116 |
^ '$Id$'
|
|
117 |
! !
|