author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 10 Apr 2008 09:14:47 +0000 | |
changeset 3 | 7909b6680107 |
parent 2 | 06f508a6f55c |
child 174 | 76f50ac2e6a0 |
permissions | -rw-r--r-- |
3
7909b6680107
Loaded into & commited from 5.3.6
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1 |
"{ Package: 'stx:goodies/xmlsuite/core' }" |
0 | 2 |
|
3 |
"{ NameSpace: XMLv2 }" |
|
4 |
||
5 |
Node subclass:#CharacterData |
|
6 |
instanceVariableNames:'data' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'XML Suite-DOM3' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!CharacterData methodsFor:'DOM3 helpers'! |
|
14 |
||
15 |
computeLookupPrefix:arg |
|
16 |
"Superclass says that I am responsible to implement this method" |
|
17 |
||
18 |
self shouldImplement |
|
19 |
||
20 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
21 |
! |
|
22 |
||
23 |
postImportBy:aDocument deep:aBoolean |
|
24 |
data := data copy |
|
25 |
||
26 |
"Created: / 25-12-2005 / 11:01:36 / janfrog" |
|
27 |
! |
|
28 |
||
29 |
textContentOn:arg |
|
30 |
"Superclass says that I am responsible to implement this method" |
|
31 |
||
32 |
self shouldImplement |
|
33 |
||
34 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
35 |
! ! |
|
36 |
||
37 |
!CharacterData methodsFor:'DOM3 interface'! |
|
38 |
||
39 |
appendData: aString |
|
40 |
||
41 |
data := data , aString |
|
42 |
||
43 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
44 |
! |
|
45 |
||
46 |
compareDocumentPosition:arg |
|
47 |
"Superclass says that I am responsible to implement this method" |
|
48 |
||
49 |
self shouldImplement |
|
50 |
||
51 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
52 |
! |
|
53 |
||
54 |
deleteData: offset count: count |
|
55 |
||
56 |
((offset between: 1 and: data size) and: [count > 0]) |
|
57 |
ifFalse: [DOMException |
|
58 |
raiseErrorString: 'Delete range out of bounds' |
|
59 |
withCode: DOMException INDEX_SIZE_ERR]. |
|
60 |
||
61 |
data := (data copyTo: offset) , (data copyFrom: offset + count + 1) |
|
62 |
||
63 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
64 |
! |
|
65 |
||
66 |
insertData: aString offset: anInteger |
|
67 |
||
68 |
(anInteger between: 1 and: data size) |
|
69 |
ifFalse: [DOMException |
|
70 |
raiseErrorString: 'Insert range out of bounds' |
|
71 |
withCode: DOMException INDEX_SIZE_ERR]. |
|
72 |
||
73 |
data := (data copyTo: anInteger) , aString , (data copyFrom: anInteger + 1) |
|
74 |
||
75 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
76 |
! |
|
77 |
||
78 |
length |
|
79 |
||
80 |
^data size |
|
81 |
||
82 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
83 |
! |
|
84 |
||
85 |
nodeName |
|
86 |
"Superclass says that I am responsible to implement this method" |
|
87 |
||
88 |
self shouldImplement |
|
89 |
||
90 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
91 |
! |
|
92 |
||
93 |
nodeType |
|
94 |
"Superclass says that I am responsible to implement this method" |
|
95 |
||
96 |
self shouldImplement |
|
97 |
||
98 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
99 |
! |
|
100 |
||
101 |
normalize |
|
102 |
"Superclass says that I am responsible to implement this method" |
|
103 |
||
104 |
self shouldImplement |
|
105 |
||
106 |
"Created: / 19-06-2005 / 13:31:19 / janfrog" |
|
107 |
! |
|
108 |
||
109 |
replaceData: offset count: count data: aString |
|
110 |
||
111 |
((offset between: 1 and: data size) and: [count > 0]) |
|
112 |
ifFalse: [DOMException |
|
113 |
raiseErrorString: 'Insert range out of bounds' |
|
114 |
withCode: DOMException INDEX_SIZE_ERR]. |
|
115 |
||
116 |
data replaceFrom: offset count: count with: aString |
|
117 |
||
118 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
119 |
! |
|
120 |
||
121 |
substringData: offset count: count |
|
122 |
||
123 |
((offset between: 1 and: data size) and: [count > 0]) |
|
124 |
ifFalse: [DOMException |
|
125 |
raiseErrorString: 'Substring range out of bounds' |
|
126 |
withCode: DOMException INDEX_SIZE_ERR]. |
|
127 |
||
128 |
||
129 |
^data copyFrom: offset count: count |
|
130 |
||
131 |
"Created: / 18-06-2005 / 21:29:21 / janfrog" |
|
132 |
! ! |
|
133 |
||
134 |
!CharacterData methodsFor:'accessing'! |
|
135 |
||
136 |
data |
|
137 |
^ data |
|
138 |
||
139 |
"Created: / 04-08-2005 / 13:33:38 / janfrog" |
|
140 |
! |
|
141 |
||
142 |
data:something |
|
143 |
data := something. |
|
144 |
||
145 |
"Created: / 04-08-2005 / 13:33:38 / janfrog" |
|
146 |
! ! |
|
147 |
||
148 |
!CharacterData methodsFor:'testing'! |
|
149 |
||
150 |
isCharacterData |
|
151 |
^ true |
|
152 |
||
153 |
"Created: / 05-08-2005 / 14:27:51 / janfrog" |
|
154 |
! ! |
|
155 |
||
156 |
!CharacterData methodsFor:'visiting'! |
|
157 |
||
158 |
acceptVisitor:aVisitor |
|
159 |
"Double dispatch back to the visitor, passing my type encoded in |
|
160 |
the selector (visitor pattern)" |
|
161 |
||
162 |
"stub code automatically generated - please change if required" |
|
163 |
||
164 |
^ aVisitor visitCharacterData:self |
|
165 |
||
166 |
"Created: / 05-08-2005 / 13:09:35 / janfrog" |
|
167 |
! ! |
|
168 |
||
169 |
!CharacterData class methodsFor:'documentation'! |
|
170 |
||
171 |
version |
|
172 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/XMLv2__CharacterData.st,v 1.2 2005-12-25 10:54:54 vranyj1 Exp $' |
|
173 |
! ! |