Documentation ¶
Index ¶
- Constants
- func ArrayCopy(src, dst *Object, srcPos, dstPos, length int32)
- func GoString(jStr *Object) string
- type Class
- func (self *Class) ArrayClass() *Class
- func (self *Class) ComponentClass() *Class
- func (self *Class) ConstantPool() *ConstantPool
- func (self *Class) GetClinitMethod() *Method
- func (self *Class) GetInstanceMethod(name, descriptor string) *Method
- func (self *Class) GetMainMethod() *Method
- func (self *Class) GetPackageName() string
- func (self *Class) GetRefVar(fieldName, fieldDescriptor string) *Object
- func (self *Class) InitStarted() bool
- func (self *Class) IsAbstract() bool
- func (self *Class) IsAnnotation() bool
- func (self *Class) IsArray() bool
- func (self *Class) IsEnum() bool
- func (self *Class) IsFinal() bool
- func (self *Class) IsImplements(iface *Class) bool
- func (self *Class) IsInterface() bool
- func (self *Class) IsJioSerializable() bool
- func (self *Class) IsJlCloneable() bool
- func (self *Class) IsJlObject() bool
- func (self *Class) IsPrimitive() bool
- func (self *Class) IsPublic() bool
- func (self *Class) IsSubClassOf(other *Class) bool
- func (self *Class) IsSuper() bool
- func (self *Class) IsSuperClassOf(other *Class) bool
- func (self *Class) IsSynthetic() bool
- func (self *Class) JClass() *Object
- func (self *Class) JavaName() string
- func (self *Class) Loader() *ClassLoader
- func (self *Class) Name() string
- func (self *Class) NewArray(count uint) *Object
- func (self *Class) NewObject() *Object
- func (self *Class) SetRefVar(fieldName, fieldDescriptor string, ref *Object)
- func (self *Class) StartInit()
- func (self *Class) StaticVars() Slots
- func (self *Class) SuperClass() *Class
- type ClassLoader
- type ClassMember
- func (self *ClassMember) Class() *Class
- func (self *ClassMember) Descriptor() string
- func (self *ClassMember) IsFinal() bool
- func (self *ClassMember) IsPrivate() bool
- func (self *ClassMember) IsProtected() bool
- func (self *ClassMember) IsPublic() bool
- func (self *ClassMember) IsStatic() bool
- func (self *ClassMember) IsSynthetic() bool
- func (self *ClassMember) Name() string
- type ClassRef
- type Constant
- type ConstantPool
- type Field
- type FieldRef
- type InterfaceMethodRef
- type MemberRef
- type Method
- func (self *Method) ArgSlotCount() uint
- func (self *Method) Code() []byte
- func (self *Method) IsAbstract() bool
- func (self *Method) IsBridge() bool
- func (self *Method) IsNative() bool
- func (self *Method) IsStrict() bool
- func (self *Method) IsSynchronized() bool
- func (self *Method) IsVarargs() bool
- func (self *Method) MaxLocals() uint
- func (self *Method) MaxStack() uint
- type MethodDescriptor
- type MethodDescriptorParser
- type MethodRef
- type Object
- func (self *Object) ArrayLength() int32
- func (self *Object) Bytes() []int8
- func (self *Object) Chars() []uint16
- func (self *Object) Class() *Class
- func (self *Object) Clone() *Object
- func (self *Object) Doubles() []float64
- func (self *Object) Extra() interface{}
- func (self *Object) Fields() Slots
- func (self *Object) Floats() []float32
- func (self *Object) GetRefVar(name, descriptor string) *Object
- func (self *Object) Ints() []int32
- func (self *Object) IsInstanceOf(class *Class) bool
- func (self *Object) Longs() []int64
- func (self *Object) Refs() []*Object
- func (self *Object) SetExtra(extra interface{})
- func (self *Object) SetRefVar(name, descriptor string, ref *Object)
- func (self *Object) Shorts() []int16
- type Slot
- type Slots
- func (self Slots) GetDouble(index uint) float64
- func (self Slots) GetFloat(index uint) float32
- func (self Slots) GetInt(index uint) int32
- func (self Slots) GetLong(index uint) int64
- func (self Slots) GetRef(index uint) *Object
- func (self Slots) SetDouble(index uint, val float64)
- func (self Slots) SetFloat(index uint, val float32)
- func (self Slots) SetInt(index uint, val int32)
- func (self Slots) SetLong(index uint, val int64)
- func (self Slots) SetRef(index uint, ref *Object)
- type SymRef
Constants ¶
View Source
const ( ACC_PUBLIC = 0x0001 // class field method ACC_PRIVATE = 0x0002 // field method ACC_PROTECTED = 0x0004 // field method ACC_STATIC = 0x0008 // field method ACC_FINAL = 0x0010 // class field method ACC_SUPER = 0x0020 // class ACC_SYNCHRONIZED = 0x0020 // method ACC_VOLATILE = 0x0040 // field ACC_BRIDGE = 0x0040 // method ACC_TRANSIENT = 0x0080 // field ACC_VARARGS = 0x0080 // method ACC_NATIVE = 0x0100 // method ACC_INTERFACE = 0x0200 // class ACC_ABSTRACT = 0x0400 // class method ACC_STRICT = 0x0800 // method ACC_SYNTHETIC = 0x1000 // class field method ACC_ANNOTATION = 0x2000 // class ACC_ENUM = 0x4000 // class field )
类,方法,字段的访问权限
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Class ¶
type Class struct {
// contains filtered or unexported fields
}
Class 类数据结构体 * 当Java虚拟机加载到类之后,会解析类文件将数据放入方法区中,也就是说我们需要定义一个结构体来存放类的相关信息。 定义Class类来存放解析类文件的信息。
name, superClassName and interfaceNames are all binary names(jvms8-4.2.1)
func (*Class) ArrayClass ¶
func (*Class) ComponentClass ¶
func (*Class) ConstantPool ¶
func (self *Class) ConstantPool() *ConstantPool
func (*Class) GetClinitMethod ¶
func (*Class) GetInstanceMethod ¶
func (*Class) GetMainMethod ¶
func (*Class) GetPackageName ¶
func (*Class) InitStarted ¶
func (*Class) IsAbstract ¶
func (*Class) IsAnnotation ¶
func (*Class) IsImplements ¶
IsImplements self implements iface
func (*Class) IsInterface ¶
func (*Class) IsJioSerializable ¶
func (*Class) IsJlCloneable ¶
func (*Class) IsJlObject ¶
func (*Class) IsPrimitive ¶
func (*Class) IsSubClassOf ¶
IsSubClassOf self extends c
func (*Class) IsSuperClassOf ¶
IsSuperClassOf c extends self
func (*Class) IsSynthetic ¶
func (*Class) Loader ¶
func (self *Class) Loader() *ClassLoader
func (*Class) StaticVars ¶
func (*Class) SuperClass ¶
type ClassLoader ¶
type ClassLoader struct {
// contains filtered or unexported fields
}
ClassLoader
class names:
- primitive types: boolean, byte, int ...
- primitive arrays: [Z, [B, [I ...
- non-array classes: java/lang/Object ...
- array classes: [Ljava/lang/Object; ...
func NewClassLoader ¶
func NewClassLoader(cp *classpath.Classpath, verboseFlag bool) *ClassLoader
func (*ClassLoader) LoadClass ¶
func (self *ClassLoader) LoadClass(name string) *Class
type ClassMember ¶
type ClassMember struct {
// contains filtered or unexported fields
}
ClassMember 字段与方法的堆区数据结构
func (*ClassMember) Class ¶
func (self *ClassMember) Class() *Class
func (*ClassMember) Descriptor ¶
func (self *ClassMember) Descriptor() string
func (*ClassMember) IsFinal ¶
func (self *ClassMember) IsFinal() bool
func (*ClassMember) IsPrivate ¶
func (self *ClassMember) IsPrivate() bool
func (*ClassMember) IsProtected ¶
func (self *ClassMember) IsProtected() bool
func (*ClassMember) IsPublic ¶
func (self *ClassMember) IsPublic() bool
func (*ClassMember) IsStatic ¶
func (self *ClassMember) IsStatic() bool
func (*ClassMember) IsSynthetic ¶
func (self *ClassMember) IsSynthetic() bool
type ConstantPool ¶
type ConstantPool struct {
// contains filtered or unexported fields
}
func (*ConstantPool) GetConstant ¶
func (self *ConstantPool) GetConstant(index uint) Constant
type Field ¶
type Field struct { ClassMember // contains filtered or unexported fields }
Field 直接对 ClassMember 进行封装
func (*Field) ConstValueIndex ¶
func (*Field) IsTransient ¶
func (*Field) IsVolatile ¶
type FieldRef ¶
type FieldRef struct { MemberRef // contains filtered or unexported fields }
func (*FieldRef) ResolvedField ¶
type InterfaceMethodRef ¶
type InterfaceMethodRef struct { MemberRef // contains filtered or unexported fields }
func (*InterfaceMethodRef) ResolvedInterfaceMethod ¶
func (self *InterfaceMethodRef) ResolvedInterfaceMethod() *Method
type MemberRef ¶
type MemberRef struct { SymRef // contains filtered or unexported fields }
func (*MemberRef) Descriptor ¶
type Method ¶
type Method struct { ClassMember // contains filtered or unexported fields }
func LookupMethodInClass ¶
func (*Method) ArgSlotCount ¶
func (*Method) IsAbstract ¶
func (*Method) IsSynchronized ¶
type MethodDescriptor ¶
type MethodDescriptor struct {
// contains filtered or unexported fields
}
type MethodDescriptorParser ¶
type MethodDescriptorParser struct {
// contains filtered or unexported fields
}
type MethodRef ¶
type MethodRef struct { MemberRef // contains filtered or unexported fields }
func (*MethodRef) ResolvedMethod ¶
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func InternString ¶
func JString ¶
func JString(loader *ClassLoader, goStr string) *Object
func (*Object) ArrayLength ¶
func (*Object) IsInstanceOf ¶
Source Files ¶
- access_flags.go
- array_class.go
- array_object.go
- class.go
- class_hierarchy.go
- class_loader.go
- class_member.go
- class_name_helper.go
- constant_pool.go
- cp_classref.go
- cp_fieldref.go
- cp_interface_methodref.go
- cp_memberref.go
- cp_methodref.go
- cp_symref.go
- field.go
- method.go
- method_descriptor.go
- method_descriptor_parser.go
- method_lookup.go
- object.go
- object_clone.go
- slots.go
- string_pool.go
Click to show internal directories.
Click to hide internal directories.