< prev index next >

src/java.base/share/classes/jdk/internal/classfile/impl/BoundAttribute.java

Print this page

 914         }
 915     }
 916 
 917     public static final class BoundPermittedSubclassesAttribute extends BoundAttribute<PermittedSubclassesAttribute>
 918             implements PermittedSubclassesAttribute {
 919         private List<ClassEntry> permittedSubclasses = null;
 920 
 921         public BoundPermittedSubclassesAttribute(ClassReader cf, AttributeMapper<PermittedSubclassesAttribute> mapper, int pos) {
 922             super(cf, mapper, pos);
 923         }
 924 
 925         @Override
 926         public List<ClassEntry> permittedSubclasses() {
 927             if (permittedSubclasses == null) {
 928                 permittedSubclasses = readEntryList(payloadStart, ClassEntry.class);
 929             }
 930             return permittedSubclasses;
 931         }
 932     }
 933 

















 934     public abstract static sealed class BoundCodeAttribute
 935             extends BoundAttribute<CodeAttribute>
 936             implements CodeAttribute
 937             permits CodeImpl {
 938         protected final int codeStart;
 939         protected final int codeLength;
 940         protected final int codeEnd;
 941         protected final int attributePos;
 942         protected final int exceptionHandlerPos;
 943         protected final int exceptionHandlerCnt;
 944         protected final MethodModel enclosingMethod;
 945 
 946         public BoundCodeAttribute(AttributedElement enclosing,
 947                                   ClassReader reader,
 948                                   AttributeMapper<CodeAttribute> mapper,
 949                                   int payloadStart) {
 950             super(reader, mapper, payloadStart);
 951             this.codeLength = classReader.readInt(payloadStart + 4);
 952             this.enclosingMethod = (MethodModel) enclosing;
 953             this.codeStart = payloadStart + 8;

 993             case 0x5208e184 ->
 994                 name.equalsString(NAME_BOOTSTRAP_METHODS) ? bootstrapMethods() : null;
 995             case 0xcb60907a ->
 996                 name.equalsString(NAME_CHARACTER_RANGE_TABLE) ? characterRangeTable() : null;
 997             case 0x4020220d ->
 998                 name.equalsString(NAME_CODE) ? code() : null;
 999             case 0xc20dd1fe ->
1000                 name.equalsString(NAME_COMPILATION_ID) ? compilationId() : null;
1001             case 0xcab1940d ->
1002                 name.equalsString(NAME_CONSTANT_VALUE) ? constantValue() : null;
1003             case 0x558641d3 ->
1004                 name.equalsString(NAME_DEPRECATED) ? deprecated() : null;
1005             case 0x51d443cd ->
1006                 name.equalsString(NAME_ENCLOSING_METHOD) ? enclosingMethod() : null;
1007             case 0x687c1624 ->
1008                 name.equalsString(NAME_EXCEPTIONS) ? exceptions() : null;
1009             case 0x7adb2910 ->
1010                 name.equalsString(NAME_INNER_CLASSES) ? innerClasses() : null;
1011             case 0x653f0551 ->
1012                 name.equalsString(NAME_LINE_NUMBER_TABLE) ? lineNumberTable() : null;


1013             case 0x64c75927 ->
1014                 name.equalsString(NAME_LOCAL_VARIABLE_TABLE) ? localVariableTable() : null;
1015             case 0x6697f98d ->
1016                 name.equalsString(NAME_LOCAL_VARIABLE_TYPE_TABLE) ? localVariableTypeTable() : null;
1017             case 0xdbb0cdcb ->
1018                 name.equalsString(NAME_METHOD_PARAMETERS) ? methodParameters() : null;
1019             case 0xc9b0928c ->
1020                 name.equalsString(NAME_MODULE) ? module() : null;
1021             case 0x41cd27e8 ->
1022                 name.equalsString(NAME_MODULE_HASHES) ? moduleHashes() : null;
1023             case 0x7deb0a13 ->
1024                 name.equalsString(NAME_MODULE_MAIN_CLASS) ? moduleMainClass() : null;
1025             case 0x6706ff99 ->
1026                 name.equalsString(NAME_MODULE_PACKAGES) ? modulePackages() : null;
1027             case 0x60272858 ->
1028                 name.equalsString(NAME_MODULE_RESOLUTION) ? moduleResolution() : null;
1029             case 0x5646d73d ->
1030                 name.equalsString(NAME_MODULE_TARGET) ? moduleTarget() : null;
1031             case 0x50336c40 ->
1032                 name.equalsString(NAME_NEST_HOST) ? nestHost() : null;

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

1010             case 0x5208e184 ->
1011                 name.equalsString(NAME_BOOTSTRAP_METHODS) ? bootstrapMethods() : null;
1012             case 0xcb60907a ->
1013                 name.equalsString(NAME_CHARACTER_RANGE_TABLE) ? characterRangeTable() : null;
1014             case 0x4020220d ->
1015                 name.equalsString(NAME_CODE) ? code() : null;
1016             case 0xc20dd1fe ->
1017                 name.equalsString(NAME_COMPILATION_ID) ? compilationId() : null;
1018             case 0xcab1940d ->
1019                 name.equalsString(NAME_CONSTANT_VALUE) ? constantValue() : null;
1020             case 0x558641d3 ->
1021                 name.equalsString(NAME_DEPRECATED) ? deprecated() : null;
1022             case 0x51d443cd ->
1023                 name.equalsString(NAME_ENCLOSING_METHOD) ? enclosingMethod() : null;
1024             case 0x687c1624 ->
1025                 name.equalsString(NAME_EXCEPTIONS) ? exceptions() : null;
1026             case 0x7adb2910 ->
1027                 name.equalsString(NAME_INNER_CLASSES) ? innerClasses() : null;
1028             case 0x653f0551 ->
1029                 name.equalsString(NAME_LINE_NUMBER_TABLE) ? lineNumberTable() : null;
1030            case 0x5f348b64 ->
1031                 name.equalsString(NAME_LOADABLE_DESCRIPTORS) ? loadableDescriptors() : null;
1032             case 0x64c75927 ->
1033                 name.equalsString(NAME_LOCAL_VARIABLE_TABLE) ? localVariableTable() : null;
1034             case 0x6697f98d ->
1035                 name.equalsString(NAME_LOCAL_VARIABLE_TYPE_TABLE) ? localVariableTypeTable() : null;
1036             case 0xdbb0cdcb ->
1037                 name.equalsString(NAME_METHOD_PARAMETERS) ? methodParameters() : null;
1038             case 0xc9b0928c ->
1039                 name.equalsString(NAME_MODULE) ? module() : null;
1040             case 0x41cd27e8 ->
1041                 name.equalsString(NAME_MODULE_HASHES) ? moduleHashes() : null;
1042             case 0x7deb0a13 ->
1043                 name.equalsString(NAME_MODULE_MAIN_CLASS) ? moduleMainClass() : null;
1044             case 0x6706ff99 ->
1045                 name.equalsString(NAME_MODULE_PACKAGES) ? modulePackages() : null;
1046             case 0x60272858 ->
1047                 name.equalsString(NAME_MODULE_RESOLUTION) ? moduleResolution() : null;
1048             case 0x5646d73d ->
1049                 name.equalsString(NAME_MODULE_TARGET) ? moduleTarget() : null;
1050             case 0x50336c40 ->
1051                 name.equalsString(NAME_NEST_HOST) ? nestHost() : null;
< prev index next >