Java: Add Class and Interface.isPackageProtected()

This commit is contained in:
Marcono1234
2021-02-25 18:21:18 +01:00
parent c5ae8d2c53
commit fa189ded9d

View File

@@ -599,6 +599,13 @@ class Class extends RefType, @class {
/** Holds if this class is a local class. */
predicate isLocal() { isLocalClass(this, _) }
/** Holds if this class is package protected, that is, neither public nor private nor protected. */
predicate isPackageProtected() {
not isPrivate() and
not isProtected() and
not isPublic()
}
override RefType getSourceDeclaration() { classes(this, _, _, result) }
/**
@@ -816,6 +823,13 @@ class Interface extends RefType, @interface {
any()
}
/** Holds if this interface is package protected, that is, neither public nor private nor protected. */
predicate isPackageProtected() {
not isPrivate() and
not isProtected() and
not isPublic()
}
override string getAPrimaryQlClass() { result = "Interface" }
}