Java: Add Member.hasQualifiedName.

This commit is contained in:
Anders Schack-Mulligen
2021-01-13 13:42:35 +01:00
parent 69664535b0
commit f3b8fe2e2e

View File

@@ -23,6 +23,14 @@ class Member extends Element, Annotatable, Modifiable, @member {
/** Gets the qualified name of this member. */
string getQualifiedName() { result = getDeclaringType().getName() + "." + getName() }
/**
* Holds if this member has the specified name and is declared in the
* specified package and type.
*/
predicate hasQualifiedName(string package, string type, string name) {
this.getDeclaringType().hasQualifiedName(package, type) and this.hasName(name)
}
/** Holds if this member is package protected, that is, neither public nor private nor protected. */
predicate isPackageProtected() {
not isPrivate() and