< prev index next > src/java.base/share/classes/jdk/internal/classfile/impl/FieldImpl.java
Print this page
/*
- * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
import java.util.Optional;
import java.util.function.Consumer;
public final class FieldImpl
extends AbstractElement
- implements FieldModel, Util.Writable {
+ implements FieldModel, WritableField {
private final ClassReader reader;
private final int startPos, endPos, attributesPos;
private List<Attribute<?>> attributes;
this.attributesPos = attributesPos;
}
@Override
public AccessFlags flags() {
- return new AccessFlagsImpl(AccessFlag.Location.FIELD, reader.readU2(startPos));
+ return new AccessFlagsImpl(AccessFlag.Location.FIELD, fieldFlags());
}
@Override
public Optional<ClassModel> parent() {
if (reader instanceof ClassReaderImpl cri)
@Override
public Utf8Entry fieldType() {
return reader.readEntry(startPos + 4, Utf8Entry.class);
}
+ @Override
+ public int fieldFlags() {
+ return reader.readU2(startPos);
+ }
+
@Override
public List<Attribute<?>> attributes() {
if (attributes == null) {
attributes = BoundAttribute.readAttributes(this, reader, attributesPos, reader.customAttributes());
}
< prev index next >