< prev index next >

src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java

Print this page


   1 /*
   2  * Copyright (c) 2001, 2017, 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


  32  * Shared constants
  33  * @author John Rose
  34  */
  35 class Constants {
  36 
  37     private Constants(){}
  38 
  39     public static final int JAVA_MAGIC = 0xCAFEBABE;
  40 
  41     /*
  42         Java Class Version numbers history
  43         1.0 to 1.3.X 45,3
  44         1.4 to 1.4.X 46,0
  45         1.5 to 1.5.X 49,0
  46         1.6 to 1.6.X 50,0
  47         1.7 to 1.7.X 51,0
  48         1.8 to 1.8.X 52,0
  49         1.9 to 1.9.X 53,0
  50         1.10 to 1.10.X 54,0
  51         1.11 to 1.11.X 55,0

  52     */
  53 
  54     public static final Package.Version JAVA_MIN_CLASS_VERSION =
  55             Package.Version.of(45, 03);
  56 
  57     public static final Package.Version JAVA5_MAX_CLASS_VERSION =
  58             Package.Version.of(49, 00);
  59 
  60     public static final Package.Version JAVA6_MAX_CLASS_VERSION =
  61             Package.Version.of(50, 00);
  62 
  63     public static final Package.Version JAVA7_MAX_CLASS_VERSION =
  64             Package.Version.of(51, 00);
  65 
  66     public static final Package.Version JAVA8_MAX_CLASS_VERSION =
  67             Package.Version.of(52, 00);
  68 
  69     public static final Package.Version JAVA9_MAX_CLASS_VERSION =
  70             Package.Version.of(53, 00);
  71 
  72     public static final Package.Version JAVA10_MAX_CLASS_VERSION =
  73             Package.Version.of(54, 00);
  74 
  75     public static final Package.Version JAVA11_MAX_CLASS_VERSION =
  76             Package.Version.of(55, 00);
  77 



  78     public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
  79 
  80     public static final Package.Version JAVA5_PACKAGE_VERSION =
  81             Package.Version.of(150, 7);
  82 
  83     public static final Package.Version JAVA6_PACKAGE_VERSION =
  84             Package.Version.of(160, 1);
  85 
  86     public static final Package.Version JAVA7_PACKAGE_VERSION =
  87             Package.Version.of(170, 1);
  88 
  89     public static final Package.Version JAVA8_PACKAGE_VERSION =
  90             Package.Version.of(171, 0);
  91 
  92     // upper limit, should point to the latest class version
  93     public static final Package.Version JAVA_MAX_CLASS_VERSION =
  94             JAVA11_MAX_CLASS_VERSION;
  95 
  96     // upper limit should point to the latest package version, for version info!.
  97     public static final Package.Version MAX_PACKAGE_VERSION =
  98             JAVA7_PACKAGE_VERSION;
  99 
 100     public static final int CONSTANT_POOL_INDEX_LIMIT  = 0x10000;
 101     public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
 102 
 103     public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
 104 
 105     public static final byte CONSTANT_Utf8 = 1;
 106     public static final byte CONSTANT_unused2 = 2;  // unused, was Unicode
 107     public static final byte CONSTANT_Integer = 3;
 108     public static final byte CONSTANT_Float = 4;
 109     public static final byte CONSTANT_Long = 5;
 110     public static final byte CONSTANT_Double = 6;
 111     public static final byte CONSTANT_Class = 7;
 112     public static final byte CONSTANT_String = 8;
 113     public static final byte CONSTANT_Fieldref = 9;
 114     public static final byte CONSTANT_Methodref = 10;


   1 /*
   2  * Copyright (c) 2001, 2018, 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


  32  * Shared constants
  33  * @author John Rose
  34  */
  35 class Constants {
  36 
  37     private Constants(){}
  38 
  39     public static final int JAVA_MAGIC = 0xCAFEBABE;
  40 
  41     /*
  42         Java Class Version numbers history
  43         1.0 to 1.3.X 45,3
  44         1.4 to 1.4.X 46,0
  45         1.5 to 1.5.X 49,0
  46         1.6 to 1.6.X 50,0
  47         1.7 to 1.7.X 51,0
  48         1.8 to 1.8.X 52,0
  49         1.9 to 1.9.X 53,0
  50         1.10 to 1.10.X 54,0
  51         1.11 to 1.11.X 55,0
  52         1.12 to 1.12.X 56,0
  53     */
  54 
  55     public static final Package.Version JAVA_MIN_CLASS_VERSION =
  56             Package.Version.of(45, 03);
  57 
  58     public static final Package.Version JAVA5_MAX_CLASS_VERSION =
  59             Package.Version.of(49, 00);
  60 
  61     public static final Package.Version JAVA6_MAX_CLASS_VERSION =
  62             Package.Version.of(50, 00);
  63 
  64     public static final Package.Version JAVA7_MAX_CLASS_VERSION =
  65             Package.Version.of(51, 00);
  66 
  67     public static final Package.Version JAVA8_MAX_CLASS_VERSION =
  68             Package.Version.of(52, 00);
  69 
  70     public static final Package.Version JAVA9_MAX_CLASS_VERSION =
  71             Package.Version.of(53, 00);
  72 
  73     public static final Package.Version JAVA10_MAX_CLASS_VERSION =
  74             Package.Version.of(54, 00);
  75 
  76     public static final Package.Version JAVA11_MAX_CLASS_VERSION =
  77             Package.Version.of(55, 00);
  78 
  79     public static final Package.Version JAVA12_MAX_CLASS_VERSION =
  80             Package.Version.of(56, 00);
  81 
  82     public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
  83 
  84     public static final Package.Version JAVA5_PACKAGE_VERSION =
  85             Package.Version.of(150, 7);
  86 
  87     public static final Package.Version JAVA6_PACKAGE_VERSION =
  88             Package.Version.of(160, 1);
  89 
  90     public static final Package.Version JAVA7_PACKAGE_VERSION =
  91             Package.Version.of(170, 1);
  92 
  93     public static final Package.Version JAVA8_PACKAGE_VERSION =
  94             Package.Version.of(171, 0);
  95 
  96     // upper limit, should point to the latest class version
  97     public static final Package.Version JAVA_MAX_CLASS_VERSION =
  98             JAVA12_MAX_CLASS_VERSION;
  99 
 100     // upper limit should point to the latest package version, for version info!.
 101     public static final Package.Version MAX_PACKAGE_VERSION =
 102             JAVA7_PACKAGE_VERSION;
 103 
 104     public static final int CONSTANT_POOL_INDEX_LIMIT  = 0x10000;
 105     public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
 106 
 107     public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
 108 
 109     public static final byte CONSTANT_Utf8 = 1;
 110     public static final byte CONSTANT_unused2 = 2;  // unused, was Unicode
 111     public static final byte CONSTANT_Integer = 3;
 112     public static final byte CONSTANT_Float = 4;
 113     public static final byte CONSTANT_Long = 5;
 114     public static final byte CONSTANT_Double = 6;
 115     public static final byte CONSTANT_Class = 7;
 116     public static final byte CONSTANT_String = 8;
 117     public static final byte CONSTANT_Fieldref = 9;
 118     public static final byte CONSTANT_Methodref = 10;


< prev index next >