1 /*
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
56 public final static Package.Version JAVA6_MAX_CLASS_VERSION =
57 Package.Version.of(50, 00);
58
59 public final static Package.Version JAVA7_MAX_CLASS_VERSION =
60 Package.Version.of(51, 00);
61
62 public final static Package.Version JAVA8_MAX_CLASS_VERSION =
63 Package.Version.of(52, 00);
64
65 public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
66
67 public final static Package.Version JAVA5_PACKAGE_VERSION =
68 Package.Version.of(150, 7);
69
70 public final static Package.Version JAVA6_PACKAGE_VERSION =
71 Package.Version.of(160, 1);
72
73 public final static Package.Version JAVA7_PACKAGE_VERSION =
74 Package.Version.of(170, 1);
75
76 // upper limit, should point to the latest class version
77 public final static Package.Version JAVA_MAX_CLASS_VERSION =
78 JAVA8_MAX_CLASS_VERSION;
79
80 // upper limit should point to the latest package version, for version info!.
81 public final static Package.Version MAX_PACKAGE_VERSION =
82 JAVA7_PACKAGE_VERSION;
83
84 public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
85 public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
86
87 public final static String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
88
89 public final static byte CONSTANT_Utf8 = 1;
90 public final static byte CONSTANT_unused2 = 2; // unused, was Unicode
91 public final static byte CONSTANT_Integer = 3;
92 public final static byte CONSTANT_Float = 4;
93 public final static byte CONSTANT_Long = 5;
94 public final static byte CONSTANT_Double = 6;
95 public final static byte CONSTANT_Class = 7;
141 public static final String[] ATTR_CONTEXT_NAME
142 = { "class", "field", "method", "code" };
143
144 // predefined attr bits
145 public static final int
146 X_ATTR_OVERFLOW = 16,
147 CLASS_ATTR_SourceFile = 17,
148 METHOD_ATTR_Code = 17,
149 FIELD_ATTR_ConstantValue = 17,
150 CLASS_ATTR_EnclosingMethod = 18,
151 METHOD_ATTR_Exceptions = 18,
152 X_ATTR_Signature = 19,
153 X_ATTR_Deprecated = 20,
154 X_ATTR_RuntimeVisibleAnnotations = 21,
155 X_ATTR_RuntimeInvisibleAnnotations = 22,
156 METHOD_ATTR_RuntimeVisibleParameterAnnotations = 23,
157 CLASS_ATTR_InnerClasses = 23,
158 METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24,
159 CLASS_ATTR_ClassFile_version = 24,
160 METHOD_ATTR_AnnotationDefault = 25,
161 CODE_ATTR_StackMapTable = 0, // new in Java 6
162 CODE_ATTR_LineNumberTable = 1,
163 CODE_ATTR_LocalVariableTable = 2,
164 CODE_ATTR_LocalVariableTypeTable = 3;
165
166 // File option bits, from LSB in ascending bit position.
167 public static final int FO_DEFLATE_HINT = 1<<0;
168 public static final int FO_IS_CLASS_STUB = 1<<1;
169
170 // Archive option bits, from LSB in ascending bit position:
171 public static final int AO_HAVE_SPECIAL_FORMATS = 1<<0;
172 public static final int AO_HAVE_CP_NUMBERS = 1<<1;
173 public static final int AO_HAVE_ALL_CODE_FLAGS = 1<<2;
174 public static final int AO_HAVE_CP_EXTRAS = 1<<3;
175 public static final int AO_HAVE_FILE_HEADERS = 1<<4;
176 public static final int AO_DEFLATE_HINT = 1<<5;
177 public static final int AO_HAVE_FILE_MODTIME = 1<<6;
178 public static final int AO_HAVE_FILE_OPTIONS = 1<<7;
179 public static final int AO_HAVE_FILE_SIZE_HI = 1<<8;
180 public static final int AO_HAVE_CLASS_FLAGS_HI = 1<<9;
|
1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
56 public final static Package.Version JAVA6_MAX_CLASS_VERSION =
57 Package.Version.of(50, 00);
58
59 public final static Package.Version JAVA7_MAX_CLASS_VERSION =
60 Package.Version.of(51, 00);
61
62 public final static Package.Version JAVA8_MAX_CLASS_VERSION =
63 Package.Version.of(52, 00);
64
65 public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
66
67 public final static Package.Version JAVA5_PACKAGE_VERSION =
68 Package.Version.of(150, 7);
69
70 public final static Package.Version JAVA6_PACKAGE_VERSION =
71 Package.Version.of(160, 1);
72
73 public final static Package.Version JAVA7_PACKAGE_VERSION =
74 Package.Version.of(170, 1);
75
76 public final static Package.Version JAVA8_PACKAGE_VERSION =
77 Package.Version.of(171, 0);
78
79 // upper limit, should point to the latest class version
80 public final static Package.Version JAVA_MAX_CLASS_VERSION =
81 JAVA8_MAX_CLASS_VERSION;
82
83 // upper limit should point to the latest package version, for version info!.
84 public final static Package.Version MAX_PACKAGE_VERSION =
85 JAVA7_PACKAGE_VERSION;
86
87 public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000;
88 public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
89
90 public final static String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
91
92 public final static byte CONSTANT_Utf8 = 1;
93 public final static byte CONSTANT_unused2 = 2; // unused, was Unicode
94 public final static byte CONSTANT_Integer = 3;
95 public final static byte CONSTANT_Float = 4;
96 public final static byte CONSTANT_Long = 5;
97 public final static byte CONSTANT_Double = 6;
98 public final static byte CONSTANT_Class = 7;
144 public static final String[] ATTR_CONTEXT_NAME
145 = { "class", "field", "method", "code" };
146
147 // predefined attr bits
148 public static final int
149 X_ATTR_OVERFLOW = 16,
150 CLASS_ATTR_SourceFile = 17,
151 METHOD_ATTR_Code = 17,
152 FIELD_ATTR_ConstantValue = 17,
153 CLASS_ATTR_EnclosingMethod = 18,
154 METHOD_ATTR_Exceptions = 18,
155 X_ATTR_Signature = 19,
156 X_ATTR_Deprecated = 20,
157 X_ATTR_RuntimeVisibleAnnotations = 21,
158 X_ATTR_RuntimeInvisibleAnnotations = 22,
159 METHOD_ATTR_RuntimeVisibleParameterAnnotations = 23,
160 CLASS_ATTR_InnerClasses = 23,
161 METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24,
162 CLASS_ATTR_ClassFile_version = 24,
163 METHOD_ATTR_AnnotationDefault = 25,
164 METHOD_ATTR_MethodParameters = 26,
165 CODE_ATTR_StackMapTable = 0, // new in Java 6
166 CODE_ATTR_LineNumberTable = 1,
167 CODE_ATTR_LocalVariableTable = 2,
168 CODE_ATTR_LocalVariableTypeTable = 3;
169
170 // File option bits, from LSB in ascending bit position.
171 public static final int FO_DEFLATE_HINT = 1<<0;
172 public static final int FO_IS_CLASS_STUB = 1<<1;
173
174 // Archive option bits, from LSB in ascending bit position:
175 public static final int AO_HAVE_SPECIAL_FORMATS = 1<<0;
176 public static final int AO_HAVE_CP_NUMBERS = 1<<1;
177 public static final int AO_HAVE_ALL_CODE_FLAGS = 1<<2;
178 public static final int AO_HAVE_CP_EXTRAS = 1<<3;
179 public static final int AO_HAVE_FILE_HEADERS = 1<<4;
180 public static final int AO_DEFLATE_HINT = 1<<5;
181 public static final int AO_HAVE_FILE_MODTIME = 1<<6;
182 public static final int AO_HAVE_FILE_OPTIONS = 1<<7;
183 public static final int AO_HAVE_FILE_SIZE_HI = 1<<8;
184 public static final int AO_HAVE_CLASS_FLAGS_HI = 1<<9;
|