918 }
919 }
920
921 public static final class BoundPermittedSubclassesAttribute extends BoundAttribute<PermittedSubclassesAttribute>
922 implements PermittedSubclassesAttribute {
923 private List<ClassEntry> permittedSubclasses = null;
924
925 public BoundPermittedSubclassesAttribute(ClassReader cf, AttributeMapper<PermittedSubclassesAttribute> mapper, int pos) {
926 super(cf, mapper, pos);
927 }
928
929 @Override
930 public List<ClassEntry> permittedSubclasses() {
931 if (permittedSubclasses == null) {
932 permittedSubclasses = readEntryList(payloadStart);
933 }
934 return permittedSubclasses;
935 }
936 }
937
938 public static abstract sealed class BoundCodeAttribute
939 extends BoundAttribute<CodeAttribute>
940 implements CodeAttribute
941 permits CodeImpl {
942 protected final int codeStart;
943 protected final int codeLength;
944 protected final int codeEnd;
945 protected final int attributePos;
946 protected final int exceptionHandlerPos;
947 protected final int exceptionHandlerCnt;
948 protected final MethodModel enclosingMethod;
949
950 public BoundCodeAttribute(AttributedElement enclosing,
951 ClassReader reader,
952 AttributeMapper<CodeAttribute> mapper,
953 int payloadStart) {
954 super(reader, mapper, payloadStart);
955 this.codeLength = classReader.readInt(payloadStart + 4);
956 this.enclosingMethod = (MethodModel) enclosing;
957 this.codeStart = payloadStart + 8;
|
918 }
919 }
920
921 public static final class BoundPermittedSubclassesAttribute extends BoundAttribute<PermittedSubclassesAttribute>
922 implements PermittedSubclassesAttribute {
923 private List<ClassEntry> permittedSubclasses = null;
924
925 public BoundPermittedSubclassesAttribute(ClassReader cf, AttributeMapper<PermittedSubclassesAttribute> mapper, int pos) {
926 super(cf, mapper, pos);
927 }
928
929 @Override
930 public List<ClassEntry> permittedSubclasses() {
931 if (permittedSubclasses == null) {
932 permittedSubclasses = readEntryList(payloadStart);
933 }
934 return permittedSubclasses;
935 }
936 }
937
938 public static final class BoundPreloadAttribute extends BoundAttribute<PreloadAttribute>
939 implements PreloadAttribute {
940 private List<ClassEntry> preloads = null;
941
942 public BoundPreloadAttribute(ClassReader cf, AttributeMapper<PreloadAttribute> mapper, int pos) {
943 super(cf, mapper, pos);
944 }
945
946 @Override
947 public List<ClassEntry> preloads() {
948 if (preloads == null) {
949 preloads = readEntryList(payloadStart);
950 }
951 return preloads;
952 }
953 }
954
955 public static abstract sealed class BoundCodeAttribute
956 extends BoundAttribute<CodeAttribute>
957 implements CodeAttribute
958 permits CodeImpl {
959 protected final int codeStart;
960 protected final int codeLength;
961 protected final int codeEnd;
962 protected final int attributePos;
963 protected final int exceptionHandlerPos;
964 protected final int exceptionHandlerCnt;
965 protected final MethodModel enclosingMethod;
966
967 public BoundCodeAttribute(AttributedElement enclosing,
968 ClassReader reader,
969 AttributeMapper<CodeAttribute> mapper,
970 int payloadStart) {
971 super(reader, mapper, payloadStart);
972 this.codeLength = classReader.readInt(payloadStart + 4);
973 this.enclosingMethod = (MethodModel) enclosing;
974 this.codeStart = payloadStart + 8;
|