Top Description Inners Fields Constructors Methods
com.sun.tools.javac.jvm

public Class ClassFile

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.tools.javac.jvm.ClassWriter
Imports
com.sun.tools.javac.util.Name

A JVM class file.

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Name
externalize(Name name)

Return external representation of given name, converting '/' to '.'.

public static String
externalize(String name)

Return external representation of given name, converting '/' to '.'.

public static byte[]
internalize(byte[] buf, int offset, int len)

Return internal representation of buf[offset..offset+len-1], converting '/' to '.'.

public static Name
internalize(Name name)

Return internal representation of given name, converting '/' to '.'.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONSTANT_Classback to summary
public static final int CONSTANT_Class
CONSTANT_Doubleback to summary
public static final int CONSTANT_Double
CONSTANT_Dynamicback to summary
public static final int CONSTANT_Dynamic
CONSTANT_Fieldrefback to summary
public static final int CONSTANT_Fieldref
CONSTANT_Floatback to summary
public static final int CONSTANT_Float
CONSTANT_Integerback to summary
public static final int CONSTANT_Integer
CONSTANT_InterfaceMethodrefback to summary
public static final int CONSTANT_InterfaceMethodref
CONSTANT_InvokeDynamicback to summary
public static final int CONSTANT_InvokeDynamic
CONSTANT_Longback to summary
public static final int CONSTANT_Long
CONSTANT_MethodHandleback to summary
public static final int CONSTANT_MethodHandle
CONSTANT_Methodrefback to summary
public static final int CONSTANT_Methodref
CONSTANT_MethodTypeback to summary
public static final int CONSTANT_MethodType
CONSTANT_Moduleback to summary
public static final int CONSTANT_Module
CONSTANT_NameandTypeback to summary
public static final int CONSTANT_NameandType
CONSTANT_Packageback to summary
public static final int CONSTANT_Package
CONSTANT_Stringback to summary
public static final int CONSTANT_String
CONSTANT_Unicodeback to summary
public static final int CONSTANT_Unicode
CONSTANT_Utf8back to summary
public static final int CONSTANT_Utf8
JAVA_MAGICback to summary
public static final int JAVA_MAGIC
MAX_CODEback to summary
public static final int MAX_CODE
MAX_DIMENSIONSback to summary
public static final int MAX_DIMENSIONS
MAX_LOCALSback to summary
public static final int MAX_LOCALS
MAX_PARAMETERSback to summary
public static final int MAX_PARAMETERS
MAX_STACKback to summary
public static final int MAX_STACK
PREVIEW_MINOR_VERSIONback to summary
public static final int PREVIEW_MINOR_VERSION
REF_getFieldback to summary
public static final int REF_getField
REF_getStaticback to summary
public static final int REF_getStatic
REF_invokeInterfaceback to summary
public static final int REF_invokeInterface
REF_invokeSpecialback to summary
public static final int REF_invokeSpecial
REF_invokeStaticback to summary
public static final int REF_invokeStatic
REF_invokeVirtualback to summary
public static final int REF_invokeVirtual
REF_newInvokeSpecialback to summary
public static final int REF_newInvokeSpecial
REF_putFieldback to summary
public static final int REF_putField
REF_putStaticback to summary
public static final int REF_putStatic

Constructor Detail

ClassFileback to summary
public ClassFile()

Method Detail

externalizeback to summary
public static Name externalize(Name name)

Return external representation of given name, converting '/' to '.'.

Note

the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names, which defines "internal name" to be the form using "/" instead of "."

externalizeback to summary
public static String externalize(String name)

Return external representation of given name, converting '/' to '.'.

Note

the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names, which defines "internal name" to be the form using "/" instead of "."

internalizeback to summary
public static byte[] internalize(byte[] buf, int offset, int len)

Return internal representation of buf[offset..offset+len-1], converting '/' to '.'.

Note

the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names, which defines "internal name" to be the form using "/" instead of "."

internalizeback to summary
public static Name internalize(Name name)

Return internal representation of given name, converting '/' to '.'.

Note

the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names, which defines "internal name" to be the form using "/" instead of "."

com.sun.tools.javac.jvm back to summary

public final Enum ClassFile.Version

extends Enum<ClassFile.Version>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final int
private static final ClassFile.Version
private static final ClassFile.Version
public final int
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version
public static final ClassFile.Version

Constructor Summary

AccessConstructor and Description
private
Version(int major, int minor)

Method Summary

Modifier and TypeMethod and Description
public static ClassFile.Version
MAX()

Return the largest version supported, MAX

public static ClassFile.Version
MIN()

Return the least version supported, MIN

public static ClassFile.Version
public static ClassFile.Version[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

majorback to summary
public final int major
MAXback to summary
private static final ClassFile.Version MAX
MINback to summary
private static final ClassFile.Version MIN
minorback to summary
public final int minor
V45_3back to summary
public static final ClassFile.Version V45_3
V48back to summary
public static final ClassFile.Version V48
V49back to summary
public static final ClassFile.Version V49
V50back to summary
public static final ClassFile.Version V50
V51back to summary
public static final ClassFile.Version V51
V52back to summary
public static final ClassFile.Version V52
V53back to summary
public static final ClassFile.Version V53
V54back to summary
public static final ClassFile.Version V54
V55back to summary
public static final ClassFile.Version V55
V56back to summary
public static final ClassFile.Version V56
V57back to summary
public static final ClassFile.Version V57
V58back to summary
public static final ClassFile.Version V58
V59back to summary
public static final ClassFile.Version V59
V60back to summary
public static final ClassFile.Version V60
V61back to summary
public static final ClassFile.Version V61
V62back to summary
public static final ClassFile.Version V62
V63back to summary
public static final ClassFile.Version V63
V64back to summary
public static final ClassFile.Version V64
V65back to summary
public static final ClassFile.Version V65
V66back to summary
public static final ClassFile.Version V66

Constructor Detail

Versionback to summary
private Version(int major, int minor)

Method Detail

MAXback to summary
public static ClassFile.Version MAX()

Return the largest version supported, MAX

MINback to summary
public static ClassFile.Version MIN()

Return the least version supported, MIN

valueOfback to summary
public static ClassFile.Version valueOf(String name)
valuesback to summary
public static ClassFile.Version[] values()