public class ClassFile extends Object
Generic Java classfiles have one additional attribute for classes, methods and fields:
"Signature" (u4 attr-length, u2 signature-index)
A signature gives the full Java type of a method or field. When used as a class attribute, it indicates type parameters, followed by supertype, followed by all interfaces.
methodOrFieldSignature ::= type classSignature ::= [ typeparams ] supertype { interfacetype }
The type syntax in signatures is extended as follows:
type ::= ... | classtype | methodtype | typevar classtype ::= classsig { '.' classsig } classig ::= 'L' name [typeargs] ';' methodtype ::= [ typeparams ] '(' { type } ')' type typevar ::= 'T' name ';' typeargs ::= '<' type { type } '>' typeparams ::= '<' typeparam { typeparam } '>' typeparam ::= name ':' type
This class defines constants used in class files as well as routines to convert between internal ``.'' and external ``/'' separators in class names.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
static class |
ClassFile.NameAndType
A class for the name-and-type signature of a method or field.
|
static class |
ClassFile.Version |
Modifier and Type | Field and Description |
---|---|
static int |
CONSTANT_Class |
static int |
CONSTANT_Double |
static int |
CONSTANT_Fieldref |
static int |
CONSTANT_Float |
static int |
CONSTANT_Integer |
static int |
CONSTANT_InterfaceMethodref |
static int |
CONSTANT_InvokeDynamic |
static int |
CONSTANT_Long |
static int |
CONSTANT_MethodHandle |
static int |
CONSTANT_Methodref |
static int |
CONSTANT_MethodType |
static int |
CONSTANT_NameandType |
static int |
CONSTANT_String |
static int |
CONSTANT_Unicode |
static int |
CONSTANT_Utf8 |
static int |
JAVA_MAGIC |
static int |
MAX_CODE |
static int |
MAX_DIMENSIONS |
static int |
MAX_LOCALS |
static int |
MAX_PARAMETERS |
static int |
MAX_STACK |
static int |
REF_getField |
static int |
REF_getStatic |
static int |
REF_invokeInterface |
static int |
REF_invokeSpecial |
static int |
REF_invokeStatic |
static int |
REF_invokeVirtual |
static int |
REF_newInvokeSpecial |
static int |
REF_putField |
static int |
REF_putStatic |
Constructor and Description |
---|
ClassFile() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
externalize(byte[] buf,
int offset,
int len)
Return external representation of buf[offset..offset+len-1],
converting '.' to '/'.
|
static byte[] |
externalize(Name name)
Return external representation of given name,
converting '/' to '.'.
|
static byte[] |
internalize(byte[] buf,
int offset,
int len)
Return internal representation of buf[offset..offset+len-1],
converting '/' to '.'.
|
static byte[] |
internalize(Name name)
Return internal representation of given name,
converting '/' to '.'.
|
public static final int JAVA_MAGIC
public static final int CONSTANT_Utf8
public static final int CONSTANT_Unicode
public static final int CONSTANT_Integer
public static final int CONSTANT_Float
public static final int CONSTANT_Long
public static final int CONSTANT_Double
public static final int CONSTANT_Class
public static final int CONSTANT_String
public static final int CONSTANT_Fieldref
public static final int CONSTANT_Methodref
public static final int CONSTANT_InterfaceMethodref
public static final int CONSTANT_NameandType
public static final int CONSTANT_MethodHandle
public static final int CONSTANT_MethodType
public static final int CONSTANT_InvokeDynamic
public static final int REF_getField
public static final int REF_getStatic
public static final int REF_putField
public static final int REF_putStatic
public static final int REF_invokeVirtual
public static final int REF_invokeStatic
public static final int REF_invokeSpecial
public static final int REF_newInvokeSpecial
public static final int REF_invokeInterface
public static final int MAX_PARAMETERS
public static final int MAX_DIMENSIONS
public static final int MAX_CODE
public static final int MAX_LOCALS
public static final int MAX_STACK
public static byte[] internalize(byte[] buf, int offset, int len)
public static byte[] internalize(Name name)
public static byte[] externalize(byte[] buf, int offset, int len)
public static byte[] externalize(Name name)
Copyright © 2017 earcam. All rights reserved.