Package randoop.reflection
Class AccessibilityPredicate
java.lang.Object
randoop.reflection.AccessibilityPredicate
- Direct Known Subclasses:
AccessibilityPredicate.AnyAccessibilityPredicate
,AccessibilityPredicate.NotPrivateAccessibilityPredicate
,AccessibilityPredicate.PackageAccessibilityPredicate
,AccessibilityPredicate.PublicAccessibilityPredicate
Interface for predicates that check whether a class or class member is considered accessible.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
AnyAccessibilityPredicate is aAccessibilityPredicate
that always returns true.private static class
NotPrivateAccessibilityPredicate is aAccessibilityPredicate
that returns true in the case that the class/method/constructor/field is not declared to be private.static class
A predicate that tests for accessibility of a class, method, constructor, or field relative to a particular package.private static class
PublicAccessibilityPredicate is aAccessibilityPredicate
that returns true in the case that the class/method/constructor/field is public. -
Field Summary
Modifier and TypeFieldDescriptionstatic AccessibilityPredicate
A predicate that always returns true.static AccessibilityPredicate
A predicate that returns true for non-private elements.static AccessibilityPredicate
A predicate that returns true for public elements. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
isAccessible
(Class<?> c) Determines whether this AccessibilityPredicate considers aClass
accessible.abstract boolean
Determines whether this AccessibilityPredicate considers aMethod
orConstructor
accessible.abstract boolean
Determines whether this AccessibilityPredicate considers aField
accessible.
-
Field Details
-
IS_PUBLIC
A predicate that returns true for public elements. -
IS_NOT_PRIVATE
A predicate that returns true for non-private elements. -
IS_ANY
A predicate that always returns true.
-
-
Constructor Details
-
AccessibilityPredicate
public AccessibilityPredicate()
-
-
Method Details
-
isAccessible
Determines whether this AccessibilityPredicate considers aClass
accessible.- Parameters:
c
- the class object to check- Returns:
- whether this considers the class to be accessible
-
isAccessible
Determines whether this AccessibilityPredicate considers aMethod
orConstructor
accessible. Does not test the accessibility of the containing class.- Parameters:
e
- the method/constructor object to check- Returns:
- whether this considers the method/constructor to be accessible
-
isAccessible
Determines whether this AccessibilityPredicate considers aField
accessible. Does not test the accessibility of the containing class.- Parameters:
f
- the field object to check- Returns:
- whether this considers the field to be accessible
-