Add error-page check

This commit is contained in:
luchua-bc
2020-10-30 16:45:56 +00:00
parent a61f814b4b
commit 93d1393ded
4 changed files with 62 additions and 2 deletions

View File

@@ -130,3 +130,40 @@ class WebListenerClass extends WebXMLElement {
*/
Class getClass() { result.getQualifiedName() = getValue() }
}
/**
* An `<error-page>` element in a `web.xml` file.
*/
class WebErrorPage extends WebXMLElement {
WebErrorPage() { this.getName() = "error-page" }
/**
* Gets the `<exception-type>` element of this `<error-page>`.
*/
WebErrorPageType getPageType() { result = getAChild() }
/**
* Gets the `<location>` element of this `<error-page>`.
*/
WebErrorPageLocation getPageLocation() { result = getAChild() }
}
/**
* An `<exception-type>` element in a `web.xml` file, nested under an `<error-page>` element.
*/
class WebErrorPageType extends WebXMLElement {
WebErrorPageType() {
getName() = "exception-type" and
getParent() instanceof WebErrorPage
}
}
/**
* A `<location>` element in a `web.xml` file, nested under an `<error-page>` element.
*/
class WebErrorPageLocation extends WebXMLElement {
WebErrorPageLocation() {
getName() = "location" and
getParent() instanceof WebErrorPage
}
}