Interface AccessFlags
- All Superinterfaces:
ClassElementPREVIEW,ClassFileElementPREVIEW,FieldElementPREVIEW,MethodElementPREVIEW
public sealed interface AccessFlags
extends ClassElementPREVIEW, MethodElementPREVIEW, FieldElementPREVIEW
AccessFlags is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the access flags for a class, method, or field. Delivered as a
ClassElementPREVIEW, FieldElementPREVIEW, or MethodElementPREVIEW
when traversing the corresponding model type.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionflags()Returns the access flags.intReturns the access flags, as a bit mask.booleanhas(AccessFlag flag) Returns whether the specified flag is present.location()Returns the classfile location for this element, which is either class, method, or field.
-
Method Details
-
flagsMask
int flagsMask()Returns the access flags, as a bit mask.- Returns:
- the access flags, as a bit mask
-
flags
-
has
Returns whether the specified flag is present. The specified flag should be a valid flag for the classfile location associated with this element otherwise false is returned.- Parameters:
flag- the flag to test- Returns:
- whether the specified flag is present
-
location
AccessFlag.Location location()Returns the classfile location for this element, which is either class, method, or field.- Returns:
- the classfile location for this element, which is either class, method, or field
-
AccessFlagswhen preview features are enabled.