Enum ModifierOwner.Visibility
- java.lang.Object
-
- java.lang.Enum<ModifierOwner.Visibility>
-
- net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility
-
- All Implemented Interfaces:
Serializable
,Comparable<ModifierOwner.Visibility>
- Enclosing interface:
- ModifierOwner
public static enum ModifierOwner.Visibility extends Enum<ModifierOwner.Visibility>
Represents the visibility of a declaration.The ordering of the constants encodes a "contains" relationship, ie, given two visibilities
v1
andv2
,v1 < v2
means thatv2
is strictly more permissive thanv1
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description V_ANONYMOUS
Special visibility of anonymous classes, even more restricted than local.V_LOCAL
Confined to a local scope, eg method parameters, local variables, local classes.V_PACKAGE
Package-private.V_PRIVATE
File-private.V_PROTECTED
Package-private + visible to subclasses.V_PUBLIC
Visible everywhere.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAtLeast(ModifierOwner.Visibility other)
Returns true if this visibility is greater than or equal to the parameter.boolean
isAtMost(ModifierOwner.Visibility other)
Returns true if this visibility is lower than or equal to the parameter.String
toString()
static ModifierOwner.Visibility
valueOf(String name)
Returns the enum constant of this type with the specified name.static ModifierOwner.Visibility[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
V_ANONYMOUS
public static final ModifierOwner.Visibility V_ANONYMOUS
Special visibility of anonymous classes, even more restricted than local.
-
V_LOCAL
public static final ModifierOwner.Visibility V_LOCAL
Confined to a local scope, eg method parameters, local variables, local classes.
-
V_PRIVATE
public static final ModifierOwner.Visibility V_PRIVATE
File-private. Corresponds to modifierJModifier.PRIVATE
.
-
V_PACKAGE
public static final ModifierOwner.Visibility V_PACKAGE
Package-private.
-
V_PROTECTED
public static final ModifierOwner.Visibility V_PROTECTED
Package-private + visible to subclasses. Corresponds to modifierJModifier.PROTECTED
.
-
V_PUBLIC
public static final ModifierOwner.Visibility V_PUBLIC
Visible everywhere. Corresponds to modifierJModifier.PUBLIC
.
-
-
Method Detail
-
values
public static ModifierOwner.Visibility[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ModifierOwner.Visibility c : ModifierOwner.Visibility.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ModifierOwner.Visibility valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
public String toString()
- Overrides:
toString
in classEnum<ModifierOwner.Visibility>
-
isAtLeast
public boolean isAtLeast(ModifierOwner.Visibility other)
Returns true if this visibility is greater than or equal to the parameter.
-
isAtMost
public boolean isAtMost(ModifierOwner.Visibility other)
Returns true if this visibility is lower than or equal to the parameter.
-
-