1
|
1 |
JavaUnresolvedConstant subclass:#JavaUnresolvedClassConstant
|
21
|
2 |
instanceVariableNames:'fullName pool poolIndex'
|
1
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Java-Reader-Support'
|
|
6 |
!
|
|
7 |
|
|
8 |
|
|
9 |
!JavaUnresolvedClassConstant class methodsFor:'instance creation'!
|
|
10 |
|
54
|
11 |
fullName:nm
|
|
12 |
^ self new fullName:nm
|
|
13 |
!
|
|
14 |
|
21
|
15 |
nameIndex:index pool:aConstantPool slotIndex:slotIndex
|
|
16 |
^ self new index:index pool:aConstantPool slotIndex:slotIndex
|
|
17 |
! !
|
|
18 |
|
|
19 |
!JavaUnresolvedClassConstant methodsFor:'accessing'!
|
|
20 |
|
|
21 |
fullName
|
|
22 |
^ fullName
|
|
23 |
|
|
24 |
!
|
|
25 |
|
54
|
26 |
fullName:nm
|
|
27 |
fullName := nm
|
|
28 |
|
|
29 |
!
|
|
30 |
|
21
|
31 |
index:index pool:aConstantPool slotIndex:slotIndex
|
|
32 |
super index:index.
|
|
33 |
pool := aConstantPool.
|
|
34 |
poolIndex := slotIndex.
|
|
35 |
|
1
|
36 |
! !
|
|
37 |
|
41
|
38 |
!JavaUnresolvedClassConstant methodsFor:'printing & storing'!
|
|
39 |
|
|
40 |
displayString
|
52
|
41 |
fullName isNil ifTrue:[
|
|
42 |
^ 'Unresolved(** nil **)'
|
|
43 |
].
|
41
|
44 |
^ 'Unresolved(' , (fullName copy replaceAll:$/ by:$.) , ')'
|
|
45 |
! !
|
|
46 |
|
1
|
47 |
!JavaUnresolvedClassConstant methodsFor:'resolving'!
|
|
48 |
|
21
|
49 |
resolve
|
50
|
50 |
|cls|
|
|
51 |
|
|
52 |
cls := Java classNamed:fullName.
|
52
|
53 |
cls notNil ifTrue:[
|
|
54 |
pool notNil ifTrue:[
|
|
55 |
pool at:poolIndex put:cls
|
|
56 |
].
|
|
57 |
] ifFalse:[
|
|
58 |
Java rememberUnresolved:self.
|
50
|
59 |
].
|
|
60 |
^ cls
|
21
|
61 |
|
|
62 |
"Created: 15.4.1996 / 15:51:42 / cg"
|
|
63 |
"Modified: 15.4.1996 / 16:26:05 / cg"
|
|
64 |
!
|
|
65 |
|
1
|
66 |
resolveFrom:aConstantTable
|
52
|
67 |
|cls nm s|
|
1
|
68 |
|
21
|
69 |
fullName := self class resolve:(aConstantTable at:index) from:aConstantTable.
|
32
|
70 |
cls := Java classNamed:fullName.
|
21
|
71 |
cls notNil ifTrue:[
|
|
72 |
^ cls
|
|
73 |
].
|
52
|
74 |
|
|
75 |
(fullName startsWith:'[') ifTrue:[
|
|
76 |
"/ a ref for newarray or new
|
|
77 |
s := fullName readStream.
|
|
78 |
s next.
|
|
79 |
fullName := JavaMethod retvalSpecFromStream:s.
|
|
80 |
cls := Java classNamed:fullName.
|
|
81 |
cls notNil ifTrue:[
|
|
82 |
^ cls
|
|
83 |
].
|
|
84 |
].
|
|
85 |
|
21
|
86 |
Java rememberUnresolved:self.
|
|
87 |
^ self
|
|
88 |
"/ ^ JavaClass fullName:fullName
|
1
|
89 |
|
|
90 |
"Created: 15.4.1996 / 15:51:42 / cg"
|
|
91 |
"Modified: 15.4.1996 / 16:26:05 / cg"
|
|
92 |
! !
|
|
93 |
|
|
94 |
!JavaUnresolvedClassConstant class methodsFor:'documentation'!
|
|
95 |
|
|
96 |
version
|
54
|
97 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaUnresolvedClassConstant.st,v 1.10 1996/05/06 18:57:25 cg Exp $'
|
1
|
98 |
! !
|