Interface Accessible
- All Known Subinterfaces:
ArrayType,ClassType,Field,InterfaceType,Method,ReferenceType,TypeComponent
public interface Accessible
Provides information on the accessibility of a type or type component.
Mirrors for program elements which allow an
an access specifier (private, protected, public) provide information
on that part of the declaration through this interface.
- Since:
- 1.3
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this object mirrors a package private item.booleanDetermines if this object mirrors a private item.booleanDetermines if this object mirrors a protected item.booleanisPublic()Determines if this object mirrors a public item.intReturns the Java programming language modifiers, encoded in an integer.
-
Method Details
-
modifiers
int modifiers()Returns the Java programming language modifiers, encoded in an integer.The modifier encodings are defined in The Java Virtual Machine Specification in the
access_flagtables for classes(section 4.1), fields(section 4.5), and methods(section 4.6). -
isPrivate
boolean isPrivate()Determines if this object mirrors a private item. ForArrayType, the return value depends on the array component type. For primitive arrays the return value is always false. For object arrays, the return value is the same as would be returned for the component type. For primitive classes, such asInteger.TYPE, the return value is always false.- Returns:
truefor items with private access;falseotherwise.
-
isPackagePrivate
boolean isPackagePrivate()Determines if this object mirrors a package private item. A package private item is declared with no access specifier. ForArrayType, the return value depends on the array component type. For primitive arrays the return value is always false. For object arrays, the return value is the same as would be returned for the component type. For primitive classes, such asInteger.TYPE, the return value is always false.- Returns:
truefor items with package private access;falseotherwise.
-
isProtected
boolean isProtected()Determines if this object mirrors a protected item. ForArrayType, the return value depends on the array component type. For primitive arrays the return value is always false. For object arrays, the return value is the same as would be returned for the component type. For primitive classes, such asInteger.TYPE, the return value is always false.- Returns:
truefor items with private access;falseotherwise.
-
isPublic
boolean isPublic()Determines if this object mirrors a public item. ForArrayType, the return value depends on the array component type. For primitive arrays the return value is always true. For object arrays, the return value is the same as would be returned for the component type. For primitive classes, such asInteger.TYPE, the return value is always true.- Returns:
truefor items with public access;falseotherwise.
-