class files.
A ClassFile is a context with a set of options that condition how
parsing and generation are done.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | ClassFile.
The option describing user-defined attributes for parsing |
| public static enum | ClassFile.
The option describing whether to retain or discard attributes that cannot verify their correctness after a transformation. |
| public static interface | ClassFile.
The option describing the class hierarchy resolver to use when generating stack maps or verifying classes. |
| public static enum | ClassFile.
Option describing whether to extend from the original constant pool when
transforming a |
| public static enum | ClassFile.
The option describing whether to patch out unreachable code for stack map generation. |
| public static enum | ClassFile.
The option describing whether to filter unbound labels and drop their enclosing structures if possible. |
| public static enum | ClassFile.
The option describing whether to process or discard debug |
| public static enum | ClassFile.
The option describing whether to process or discard |
| public static interface | ClassFile.
An option that affects the parsing or writing of |
| public static enum | ClassFile.
The option describing whether to automatically rewrite short jumps to equivalent instructions when necessary. |
| public static enum | ClassFile.
The option describing whether to generate stack maps. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ACC_ABSTRACT
The bit mask of |
| public static final int | ACC_ANNOTATION
The bit mask of |
| public static final int | ACC_BRIDGE
The bit mask of |
| public static final int | ACC_ENUM
The bit mask of |
| public static final int | ACC_FINAL
The bit mask of |
| public static final int | ACC_INTERFACE
The bit mask of |
| public static final int | ACC_MANDATED
The bit mask of |
| public static final int | ACC_MODULE
The bit mask of |
| public static final int | ACC_NATIVE
The bit mask of |
| public static final int | ACC_OPEN
The bit mask of |
| public static final int | ACC_PRIVATE
The bit mask of |
| public static final int | ACC_PROTECTED
The bit mask of |
| public static final int | ACC_PUBLIC
The bit mask of |
| public static final int | ACC_STATIC
The bit mask of |
| public static final int | ACC_STATIC_PHASE
The bit mask of |
| public static final int | ACC_STRICT
The bit mask of |
| public static final int | ACC_SUPER
The bit mask of |
| public static final int | ACC_SYNCHRONIZED
The bit mask of |
| public static final int | ACC_SYNTHETIC
The bit mask of |
| public static final int | ACC_TRANSIENT
The bit mask of |
| public static final int | ACC_TRANSITIVE
The bit mask of |
| public static final int | ACC_VARARGS
The bit mask of |
| public static final int | ACC_VOLATILE
The bit mask of |
| public static final int | JAVA_10_VERSION
The class major version introduced by Java SE 10, . |
| public static final int | JAVA_11_VERSION
The class major version introduced by Java SE 11, . |
| public static final int | JAVA_12_VERSION
The class major version introduced by Java SE 12, . |
| public static final int | JAVA_13_VERSION
The class major version introduced by Java SE 13, . |
| public static final int | JAVA_14_VERSION
The class major version introduced by Java SE 14, . |
| public static final int | JAVA_15_VERSION
The class major version introduced by Java SE 15, . |
| public static final int | JAVA_16_VERSION
The class major version introduced by Java SE 16, . |
| public static final int | JAVA_17_VERSION
The class major version introduced by Java SE 17, . |
| public static final int | JAVA_18_VERSION
The class major version introduced by Java SE 18, . |
| public static final int | JAVA_19_VERSION
The class major version introduced by Java SE 19, . |
| public static final int | JAVA_1_VERSION
The class major version of the initial version of Java, . |
| public static final int | JAVA_20_VERSION
The class major version introduced by Java SE 20, . |
| public static final int | JAVA_21_VERSION
The class major version introduced by Java SE 21, . |
| public static final int | JAVA_22_VERSION
The class major version introduced by Java SE 22, . |
| public static final int | JAVA_23_VERSION
The class major version introduced by Java SE 23, . |
| public static final int | JAVA_24_VERSION
The class major version introduced by Java SE 24, . |
| public static final int | JAVA_25_VERSION
The class major version introduced by Java SE 25, . |
| public static final int | JAVA_26_VERSION
The class major version introduced by Java SE 26, . |
| public static final int | JAVA_27_VERSION
The class major version introduced by Java SE 27, . |
| public static final int | JAVA_2_VERSION
The class major version introduced by Java 2 SE 1.2, . |
| public static final int | JAVA_3_VERSION
The class major version introduced by Java 2 SE 1.3, . |
| public static final int | JAVA_4_VERSION
The class major version introduced by Java 2 SE 1.4, . |
| public static final int | JAVA_5_VERSION
The class major version introduced by Java 2 SE 5.0, . |
| public static final int | JAVA_6_VERSION
The class major version introduced by Java SE 6, . |
| public static final int | JAVA_7_VERSION
The class major version introduced by Java SE 7, . |
| public static final int | JAVA_8_VERSION
The class major version introduced by Java SE 8, . |
| public static final int | JAVA_9_VERSION
The class major version introduced by Java SE 9, . |
| public static final int | MAGIC_NUMBER
The magic number identifying the |
| public static final int | PREVIEW_MINOR_VERSION
A minor version number indicating a class uses preview features of a Java SE release since 12, for major versions 56 and above. |
| Modifier and Type | Method and Description |
|---|---|
| public default byte[] | Returns: theclass file bytesthe name of the class to build thisClass, Consumer<? super ClassBuilder> a handler that receives a handler)ClassBuilderBuilds a |
| public byte[] | Returns: theclass file bytesthe name of the class to build thisClassEntry, ConstantPoolBuilder the constant pool builder constantPool, Consumer<? super ClassBuilder> a handler that receives a handler)ClassBuilderBuilds a |
| public default byte[] | Returns: theclass file bytesthe moduleAttribute)Module attributeBuilds a module descriptor into a byte array. |
| public default byte[] | Returns: theclass file bytesthe moduleAttribute, Consumer<? super ClassBuilder> Module attributea handler that receives a handler)ClassBuilderBuilds a module descriptor into a byte array. |
| public default void | buildModuleTo(Path
the file to write path, ModuleAttribute the moduleAttribute)Module attributeBuilds a module descriptor into a file in a file system. |
| public default void | buildModuleTo(Path
the file to write path, ModuleAttribute the moduleAttribute, Consumer<? super ClassBuilder> Module attributea handler that receives a handler)ClassBuilderBuilds a module descriptor into a file in a file system. |
| public default void | buildTo(Path
the path to the file to write path, ClassDesc the name of the class to build thisClass, Consumer<ClassBuilder> a handler that receives a handler)ClassBuilderBuilds a |
| public default void | buildTo(Path
the path to the file to write path, ClassEntry the name of the class to build thisClassEntry, ConstantPoolBuilder the constant pool builder constantPool, Consumer<? super ClassBuilder> a handler that receives a handler)ClassBuilderBuilds a |
| public static int | Returns: the latest class major version supported by the current runtimeReturns the latest class major version supported by the current runtime. |
| public static int | Returns: the latest class minor version supported by the current runtimeReturns the latest class minor version supported by the current runtime. |
| public static ClassFile | |
| public static ClassFile | |
| public ClassModel | Returns: the class modelthe bytes of the bytes)class fileParses a |
| public default ClassModel | |
| public default byte[] | Returns: the bytes of the new classthe class model to transform model, ClassTransform the transform transform)Transform one |
| public default byte[] | Returns: the bytes of the new classthe class model to transform model, ClassDesc new class name newClassName, ClassTransform the transform transform)Transform one |
| public byte[] | Returns: the bytes of the new classthe class model to transform model, ClassEntry new class name newClassName, ClassTransform the transform transform)Transform one |
| public List | Returns: a list of verification errors, or an empty list if no error is foundthe class model to verify model)Verify a |
| public List | Returns: a list of verification errors, or an empty list if no error is foundthe bytes)class file bytes to verifyVerify a |
| public default List | |
| public ClassFile | Returns: a context with altered options from this contextthe desired processing options optionsReturns a context with altered options from this context. |