1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.xml;
16
17 import org.htmlunit.corejs.javascript.Function;
18 import org.htmlunit.javascript.JavaScriptEngine;
19 import org.htmlunit.javascript.configuration.JsxClass;
20 import org.htmlunit.javascript.configuration.JsxConstructor;
21 import org.htmlunit.javascript.configuration.JsxGetter;
22 import org.htmlunit.javascript.configuration.JsxSetter;
23 import org.htmlunit.javascript.host.event.Event;
24 import org.htmlunit.javascript.host.event.EventTarget;
25
26
27
28
29
30
31
32
33
34 @JsxClass
35 public class XMLHttpRequestEventTarget extends EventTarget {
36
37
38
39
40 @Override
41 @JsxConstructor
42 public void jsConstructor() {
43 throw JavaScriptEngine.typeErrorIllegalConstructor();
44 }
45
46
47
48
49
50 @JsxGetter
51 public Function getOnload() {
52 return getEventHandler(Event.TYPE_LOAD);
53 }
54
55
56
57
58
59 @JsxSetter
60 public void setOnload(final Function loadHandler) {
61 setEventHandler(Event.TYPE_LOAD, loadHandler);
62 }
63
64
65
66
67
68 @JsxGetter
69 public Function getOnerror() {
70 return getEventHandler(Event.TYPE_ERROR);
71 }
72
73
74
75
76
77 @JsxSetter
78 public void setOnerror(final Function errorHandler) {
79 setEventHandler(Event.TYPE_ERROR, errorHandler);
80 }
81
82
83
84
85
86 @JsxGetter
87 public Function getOnloadstart() {
88 return getEventHandler(Event.TYPE_LOAD_START);
89 }
90
91
92
93
94
95 @JsxSetter
96 public void setOnloadstart(final Function loadstartHandler) {
97 setEventHandler(Event.TYPE_LOAD_START, loadstartHandler);
98 }
99
100
101
102
103
104 @JsxGetter
105 public Function getOnloadend() {
106 return getEventHandler(Event.TYPE_LOAD_END);
107 }
108
109
110
111
112
113 @JsxSetter
114 public void setOnloadend(final Function loadendHandler) {
115 setEventHandler(Event.TYPE_LOAD_END, loadendHandler);
116 }
117
118
119
120
121
122 @JsxGetter
123 public Function getOnprogress() {
124 return getEventHandler(Event.TYPE_PROGRESS);
125 }
126
127
128
129
130
131 @JsxSetter
132 public void setOnprogress(final Function progressHandler) {
133 setEventHandler(Event.TYPE_PROGRESS, progressHandler);
134 }
135
136
137
138
139
140 @JsxGetter
141 public Function getOntimeout() {
142 return getEventHandler(Event.TYPE_TIMEOUT);
143 }
144
145
146
147
148
149 @JsxSetter
150 public void setOntimeout(final Function timeoutHandler) {
151 setEventHandler(Event.TYPE_TIMEOUT, timeoutHandler);
152 }
153
154
155
156
157
158 public Function getOnreadystatechange() {
159 return getEventHandler(Event.TYPE_READY_STATE_CHANGE);
160 }
161
162
163
164
165
166 public void setOnreadystatechange(final Function readyStateChangeHandler) {
167 setEventHandler(Event.TYPE_READY_STATE_CHANGE, readyStateChangeHandler);
168 }
169
170
171
172
173
174 @JsxGetter
175 public Function getOnabort() {
176 return getEventHandler(Event.TYPE_ABORT);
177 }
178
179
180
181
182
183 @JsxSetter
184 public void setOnabort(final Function abortHandler) {
185 setEventHandler(Event.TYPE_ABORT, abortHandler);
186 }
187 }