Enum Class Visibility
- All Implemented Interfaces:
Serializable, Comparable<Visibility>, Constable
Describes visibilities available via VisibleForTesting annotations, and provides methods to
establish whether a given
Tree should be visible.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract StringA fragment describing this visibility, to fit in a phrase like "restricted to [...]".static VisibilityfromModifiers(Set<Modifier> modifiers) booleanisAtLeastAsRestrictiveAs(Visibility visibility) booleanisMoreVisibleThan(Visibility visibility) abstract booleanshouldBeVisible(Tree tree, VisitorState state) Whethertreeshould be visible from the path instateassuming we're in prod code.abstract booleanshouldBeVisible(com.sun.tools.javac.code.Symbol symbol, VisitorState state) Whethersymbolshould be visible from the path instateassuming we're in prod code.static VisibilityReturns the enum constant of this class with the specified name.static Visibility[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface Comparable
compareTo
-
Enum Constant Details
-
NONE
-
PRIVATE
-
PACKAGE_PRIVATE
-
PROTECTED
-
PUBLIC
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
shouldBeVisible
Whethertreeshould be visible from the path instateassuming we're in prod code. -
shouldBeVisible
Whethersymbolshould be visible from the path instateassuming we're in prod code. -
fromModifiers
-
isAtLeastAsRestrictiveAs
-
isMoreVisibleThan
-
description
A fragment describing this visibility, to fit in a phrase like "restricted to [...]".This is complicated by
NONE, which doesn't describe a Java visibility.
-