< prev index next > src/java.base/share/classes/java/lang/classfile/Attributes.java
Print this page
import java.lang.classfile.attribute.ModuleResolutionAttribute;
import java.lang.classfile.attribute.ModuleTargetAttribute;
import java.lang.classfile.attribute.NestHostAttribute;
import java.lang.classfile.attribute.NestMembersAttribute;
import java.lang.classfile.attribute.PermittedSubclassesAttribute;
+ import java.lang.classfile.attribute.PreloadAttribute;
import java.lang.classfile.attribute.RecordAttribute;
import java.lang.classfile.attribute.RecordComponentInfo;
import java.lang.classfile.attribute.RuntimeInvisibleAnnotationsAttribute;
import java.lang.classfile.attribute.RuntimeInvisibleParameterAnnotationsAttribute;
import java.lang.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute;
public static final String NAME_NEST_MEMBERS = "NestMembers";
/** PermittedSubclasses */
public static final String NAME_PERMITTED_SUBCLASSES = "PermittedSubclasses";
+ /** Preload */
+ public static final String NAME_PRELOAD = "Preload";
+
/** Record */
public static final String NAME_RECORD = "Record";
/** RuntimeInvisibleAnnotations */
public static final String NAME_RUNTIME_INVISIBLE_ANNOTATIONS = "RuntimeInvisibleAnnotations";
public AttributeMapper.AttributeStability stability() {
return AttributeStability.CP_REFS;
}
};
+ /** Attribute mapper for the {@code Preload} attribute */
+ public static final AttributeMapper<PreloadAttribute>
+ PRELOAD = new AbstractAttributeMapper<>(NAME_PRELOAD) {
+ @Override
+ public PreloadAttribute readAttribute(AttributedElement e, ClassReader cf, int p) {
+ return new BoundAttribute.BoundPreloadAttribute(cf, this, p);
+ }
+
+ @Override
+ protected void writeBody(BufWriter buf, PreloadAttribute attr) {
+ buf.writeListIndices(attr.preloads());
+ }
+
+ @Override
+ public AttributeMapper.AttributeStability stability() {
+ return AttributeStability.CP_REFS;
+ }
+ };
+
/** Attribute mapper for the {@code Record} attribute */
public static final AttributeMapper<RecordAttribute>
RECORD = new AbstractAttributeMapper<>(NAME_RECORD) {
@Override
public RecordAttribute readAttribute(AttributedElement e, ClassReader cf, int p) {
MODULE_RESOLUTION,
MODULE_TARGET,
NEST_HOST,
NEST_MEMBERS,
PERMITTED_SUBCLASSES,
+ PRELOAD,
RECORD,
RUNTIME_INVISIBLE_ANNOTATIONS,
RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS,
RUNTIME_INVISIBLE_TYPE_ANNOTATIONS,
RUNTIME_VISIBLE_ANNOTATIONS,
< prev index next >