Merge pull request #5270 from Marcono1234/marcono1234/class-isPackageProtected

Java: Add Class and Interface.isPackageProtected()
This commit is contained in:
Anders Schack-Mulligen
2021-03-03 16:33:57 +01:00
committed by GitHub

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" }
}