< prev index next >

src/java.base/share/classes/java/lang/classfile/Attributes.java

Print this page
@@ -42,10 +42,11 @@
  import java.lang.classfile.attribute.ExceptionsAttribute;
  import java.lang.classfile.attribute.InnerClassInfo;
  import java.lang.classfile.attribute.InnerClassesAttribute;
  import java.lang.classfile.attribute.LineNumberInfo;
  import java.lang.classfile.attribute.LineNumberTableAttribute;
+ import java.lang.classfile.attribute.LoadableDescriptorsAttribute;
  import java.lang.classfile.attribute.LocalVariableInfo;
  import java.lang.classfile.attribute.LocalVariableTableAttribute;
  import java.lang.classfile.attribute.LocalVariableTypeInfo;
  import java.lang.classfile.attribute.LocalVariableTypeTableAttribute;
  import java.lang.classfile.attribute.MethodParameterInfo;

@@ -127,10 +128,13 @@
      public static final String NAME_INNER_CLASSES = "InnerClasses";
  
      /** LineNumberTable */
      public static final String NAME_LINE_NUMBER_TABLE = "LineNumberTable";
  
+     /** LoadableDescriptors */
+     public static final String NAME_LOADABLE_DESCRIPTORS = "LoadableDescriptors";
+ 
      /** LocalVariableTable */
      public static final String NAME_LOCAL_VARIABLE_TABLE = "LocalVariableTable";
  
      /** LocalVariableTypeTable */
      public static final String NAME_LOCAL_VARIABLE_TYPE_TABLE = "LocalVariableTypeTable";

@@ -718,10 +722,29 @@
                  public AttributeMapper.AttributeStability stability() {
                      return AttributeStability.CP_REFS;
                  }
              };
  
+     /** Attribute mapper for the {@code LoadableDescriptors} attribute */
+     public static final AttributeMapper<LoadableDescriptorsAttribute>
+             LOADABLE_DESCRIPTORS = new AbstractAttributeMapper<>(NAME_LOADABLE_DESCRIPTORS) {
+                 @Override
+                 public LoadableDescriptorsAttribute readAttribute(AttributedElement e, ClassReader cf, int p) {
+                     return new BoundAttribute.BoundLoadableDescriptorsAttribute(cf, this, p);
+                 }
+ 
+                 @Override
+                 protected void writeBody(BufWriter buf, LoadableDescriptorsAttribute attr) {
+                     buf.writeListIndices(attr.loadableDescriptors());
+                 }
+ 
+                 @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) {

@@ -1002,10 +1025,11 @@
              DEPRECATED,
              ENCLOSING_METHOD,
              EXCEPTIONS,
              INNER_CLASSES,
              LINE_NUMBER_TABLE,
+             LOADABLE_DESCRIPTORS,
              LOCAL_VARIABLE_TABLE,
              LOCAL_VARIABLE_TYPE_TABLE,
              METHOD_PARAMETERS,
              MODULE,
              MODULE_HASHES,
< prev index next >