ClassBuilder and a FieldBuilder chooses an unspecified default value
if access flags are not provided, and a MethodBuilder is always
created with access flags.
AccessFlags cannot be created via a factory method directly; it can
be created with withFlags methods on the respective builders.
A MethodBuilder throws an IllegalArgumentException if it is
supplied an AccessFlags object that changes the preexisting
ACC_STATIC flag of the builder, because the
access flag change may invalidate previously supplied data to the builder.
API Note
The access flags of classes, methods, and fields are modeled as a standalone
object to support streaming as elements for ClassFileTransform.
Other access flags are not elements of a CompoundElement and thus not
modeled by AccessFlags; they provide their own flagsMask,
flags, and has methods.
ClassModel#flags(), FieldModel#flags(), MethodModel#flags(), ClassBuilder#withFlags, FieldBuilder#withFlags, MethodBuilder#withFlags
| Modifier and Type | Method and Description |
|---|---|
| public Set | Returns: the access flags, as a set of flag enumsReturns the access flags, as a set of flag enums. |
| public int | |
| public boolean | Returns: whether the specified flag is setthe flag to test flag)Returns whether the specified flag is set. |
| public AccessFlag. | Returns: theclass file location for this element, which is
either class, method, or fieldReturns the |
| flags | back to summary |
|---|---|
| public Set Returns the access flags, as a set of flag enums.
| |
| flagsMask | back to summary |
|---|---|
| public int flagsMask() Returns the access flags, as a bit mask. It is a
| |
| has | back to summary |
|---|---|
| public boolean has(AccessFlag flag) Returns whether the specified flag is set. If the specified flag
is not available to this location, returns
| |
| location | back to summary |
|---|---|
| public AccessFlag. Returns the
| |