@@ -31,11 +31,7 @@ module HTTP {
31
31
* Extend this class to refine existing API models. If you want to model new APIs,
32
32
* extend `HTTP::ResponseWriter::Range` instead.
33
33
*/
34
- class ResponseWriter extends Variable {
35
- ResponseWriter:: Range self ;
36
-
37
- ResponseWriter ( ) { this = self }
38
-
34
+ class ResponseWriter extends Variable instanceof ResponseWriter:: Range {
39
35
/** Gets the body that is written in this HTTP response. */
40
36
ResponseBody getBody ( ) { result .getResponseWriter ( ) = this }
41
37
@@ -47,8 +43,8 @@ module HTTP {
47
43
48
44
/** Gets a data-flow node that is a use of this response writer. */
49
45
DataFlow:: Node getANode ( ) {
50
- result = self .getANode ( ) or
51
- result .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) = self .getANode ( )
46
+ result = super .getANode ( ) or
47
+ result .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) = super .getANode ( )
52
48
}
53
49
}
54
50
@@ -100,19 +96,15 @@ module HTTP {
100
96
* Extend this class to refine existing API models. If you want to model new APIs,
101
97
* extend `HTTP::HeaderWrite::Range` instead.
102
98
*/
103
- class HeaderWrite extends DataFlow:: ExprNode {
104
- HeaderWrite:: Range self ;
105
-
106
- HeaderWrite ( ) { this = self }
107
-
99
+ class HeaderWrite extends DataFlow:: ExprNode instanceof HeaderWrite:: Range {
108
100
/** Gets the (lower-case) name of a header set by this definition. */
109
- string getHeaderName ( ) { result = self .getHeaderName ( ) }
101
+ string getHeaderName ( ) { result = super .getHeaderName ( ) }
110
102
111
103
/** Gets the value of the header set by this definition. */
112
- string getHeaderValue ( ) { result = self .getHeaderValue ( ) }
104
+ string getHeaderValue ( ) { result = super .getHeaderValue ( ) }
113
105
114
106
/** Holds if this header write defines the header `header`. */
115
- predicate definesHeader ( string header , string value ) { self .definesHeader ( header , value ) }
107
+ predicate definesHeader ( string header , string value ) { super .definesHeader ( header , value ) }
116
108
117
109
/**
118
110
* Gets the node representing the name of the header defined by this write.
@@ -121,13 +113,13 @@ module HTTP {
121
113
* sets the `Content-Type` header) may not have such a node, so callers should use
122
114
* `getHeaderName` in preference to this method).
123
115
*/
124
- DataFlow:: Node getName ( ) { result = self .getName ( ) }
116
+ DataFlow:: Node getName ( ) { result = super .getName ( ) }
125
117
126
118
/** Gets the node representing the value of the header defined by this write. */
127
- DataFlow:: Node getValue ( ) { result = self .getValue ( ) }
119
+ DataFlow:: Node getValue ( ) { result = super .getValue ( ) }
128
120
129
121
/** Gets the response writer associated with this header write, if any. */
130
- ResponseWriter getResponseWriter ( ) { result = self .getResponseWriter ( ) }
122
+ ResponseWriter getResponseWriter ( ) { result = super .getResponseWriter ( ) }
131
123
}
132
124
133
125
/** A data-flow node whose value is written to an HTTP header. */
@@ -171,11 +163,7 @@ module HTTP {
171
163
* Extend this class to refine existing API models. If you want to model new APIs,
172
164
* extend `HTTP::RequestBody::Range` instead.
173
165
*/
174
- class RequestBody extends DataFlow:: Node {
175
- RequestBody:: Range self ;
176
-
177
- RequestBody ( ) { this = self }
178
- }
166
+ class RequestBody extends DataFlow:: Node instanceof RequestBody:: Range { }
179
167
180
168
/** Provides a class for modeling new HTTP response-body APIs. */
181
169
module ResponseBody {
@@ -215,19 +203,15 @@ module HTTP {
215
203
* Extend this class to refine existing API models. If you want to model new APIs,
216
204
* extend `HTTP::ResponseBody::Range` instead.
217
205
*/
218
- class ResponseBody extends DataFlow:: Node {
219
- ResponseBody:: Range self ;
220
-
221
- ResponseBody ( ) { this = self }
222
-
206
+ class ResponseBody extends DataFlow:: Node instanceof ResponseBody:: Range {
223
207
/** Gets the response writer associated with this header write, if any. */
224
- ResponseWriter getResponseWriter ( ) { result = self .getResponseWriter ( ) }
208
+ ResponseWriter getResponseWriter ( ) { result = super .getResponseWriter ( ) }
225
209
226
210
/** Gets a content-type associated with this body. */
227
- string getAContentType ( ) { result = self .getAContentType ( ) }
211
+ string getAContentType ( ) { result = super .getAContentType ( ) }
228
212
229
213
/** Gets a dataflow node for a content-type associated with this body. */
230
- DataFlow:: Node getAContentTypeNode ( ) { result = self .getAContentTypeNode ( ) }
214
+ DataFlow:: Node getAContentTypeNode ( ) { result = super .getAContentTypeNode ( ) }
231
215
}
232
216
233
217
/** Provides a class for modeling new HTTP template response-body APIs. */
@@ -250,13 +234,9 @@ module HTTP {
250
234
* Extend this class to refine existing API models. If you want to model new APIs,
251
235
* extend `HTTP::TemplateResponseBody::Range` instead.
252
236
*/
253
- class TemplateResponseBody extends ResponseBody {
254
- override TemplateResponseBody:: Range self ;
255
-
256
- TemplateResponseBody ( ) { this = self }
257
-
237
+ class TemplateResponseBody extends ResponseBody instanceof TemplateResponseBody:: Range {
258
238
/** Gets the read of the variable inside the template where this value is read. */
259
- HtmlTemplate:: TemplateRead getRead ( ) { result = self .getRead ( ) }
239
+ HtmlTemplate:: TemplateRead getRead ( ) { result = super .getRead ( ) }
260
240
}
261
241
262
242
/** Provides a class for modeling new HTTP client request APIs. */
@@ -285,15 +265,11 @@ module HTTP {
285
265
* Extend this class to refine existing API models. If you want to model new APIs,
286
266
* extend `HTTP::ClientRequest::Range` instead.
287
267
*/
288
- class ClientRequest extends DataFlow:: Node {
289
- ClientRequest:: Range self ;
290
-
291
- ClientRequest ( ) { this = self }
292
-
268
+ class ClientRequest extends DataFlow:: Node instanceof ClientRequest:: Range {
293
269
/**
294
270
* Gets the URL of the request.
295
271
*/
296
- DataFlow:: Node getUrl ( ) { result = self .getUrl ( ) }
272
+ DataFlow:: Node getUrl ( ) { result = super .getUrl ( ) }
297
273
}
298
274
299
275
/** Provides a class for modeling new HTTP redirect APIs. */
@@ -337,16 +313,12 @@ module HTTP {
337
313
* Extend this class to refine existing API models. If you want to model new APIs,
338
314
* extend `HTTP::Redirect::Range` instead.
339
315
*/
340
- class Redirect extends DataFlow:: Node {
341
- Redirect:: Range self ;
342
-
343
- Redirect ( ) { this = self }
344
-
316
+ class Redirect extends DataFlow:: Node instanceof Redirect:: Range {
345
317
/** Gets the data-flow node representing the URL being redirected to. */
346
- DataFlow:: Node getUrl ( ) { result = self .getUrl ( ) }
318
+ DataFlow:: Node getUrl ( ) { result = super .getUrl ( ) }
347
319
348
320
/** Gets the response writer that this redirect is sent on, if any. */
349
- ResponseWriter getResponseWriter ( ) { result = self .getResponseWriter ( ) }
321
+ ResponseWriter getResponseWriter ( ) { result = super .getResponseWriter ( ) }
350
322
}
351
323
352
324
/** Provides a class for modeling new HTTP handler APIs. */
@@ -369,12 +341,8 @@ module HTTP {
369
341
* Extend this class to refine existing API models. If you want to model new APIs,
370
342
* extend `HTTP::RequestHandler::Range` instead.
371
343
*/
372
- class RequestHandler extends DataFlow:: Node {
373
- RequestHandler:: Range self ;
374
-
375
- RequestHandler ( ) { this = self }
376
-
344
+ class RequestHandler extends DataFlow:: Node instanceof RequestHandler:: Range {
377
345
/** Gets a node that is used in a check that is tested before this handler is run. */
378
- predicate guardedBy ( DataFlow:: Node check ) { self .guardedBy ( check ) }
346
+ predicate guardedBy ( DataFlow:: Node check ) { super .guardedBy ( check ) }
379
347
}
380
348
}
0 commit comments