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) Fields() []*Field
- func (self *Class) GetClinitMethod() *Method
- func (self *Class) GetMainMethod() *Method
- func (self *Class) GetPackageName() string
- func (self *Class) InitStarted() bool
- func (self Class) IsAbstract() bool
- func (self *Class) IsArray() bool
- func (self *Class) IsImplements(iface *Class) bool
- func (self *Class) IsInterface() bool
- func (self *Class) IsPrimitive() bool
- func (self *Class) IsPrivate() bool
- func (self *Class) IsProtected() 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) 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) StartInit()
- func (self Class) StaticVars() Slots
- func (self *Class) SuperClass() *Class
- type ClassLoader
- type ClassMember
- type ClassRef
- type Constant
- type ConstantPool
- type Field
- type FieldRef
- type InterfaceMethodRef
- type MemberRef
- type Method
- func (self *Method) ArgSlotCount() uint
- func (self *Method) Class() *Class
- func (self *Method) Code() []byte
- func (self Method) Descriptor() string
- func (self Method) IsAbstract() bool
- func (self *Method) IsNative() bool
- func (self Method) IsStatic() bool
- func (self Method) MaxLocals() uint
- func (self Method) MaxStack() uint
- func (self Method) MethodDescriptor() string
- func (self Method) Name() string
- 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) 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 ( // public ACC_PUBLIC = 0x0001 // private ACC_PRIVATE = 0x0002 // protected ACC_PROTECTED = 0x0004 // static ACC_STATIC = 0x0008 // final ACC_FINAL = 0x0010 // synchronized ACC_SYNCHRONIZED = 0x0020 // volatile ACC_VOLATILE = 0x0020 // super ACC_SUPER = 0x0020 // bridge ACC_BRIDGE = 0x0040 // transient ACC_TRANSIENT = 0x0040 // varargs ACC_VARARGS = 0x0080 // native ACC_NATIVE = 0x0100 // interface ACC_INTERFACE = 0x0200 // abstract ACC_ABSTRACT = 0x0400 // strict ACC_STRICT = 0x0800 // synthetic ACC_SYNTHETIC = 0x1000 // annotation ACC_ANNOTATION = 0x2000 // enum ACC_ENUM = 0x4000 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Class ¶
type Class struct {
// contains filtered or unexported fields
}
func (*Class) ComponentClass ¶ added in v1.8.0
func (*Class) ConstantPool ¶
func (self *Class) ConstantPool() *ConstantPool
func (*Class) GetClinitMethod ¶ added in v1.8.0
func (*Class) GetMainMethod ¶
func (*Class) GetPackageName ¶ added in v1.7.0
func (Class) IsAbstract ¶
func (*Class) IsImplements ¶ added in v1.7.0
self implements iface
func (*Class) IsInterface ¶
func (*Class) IsPrimitive ¶ added in v1.9.0
func (*Class) IsProtected ¶
func (*Class) IsSubClassOf ¶ added in v1.7.0
self extends c
func (*Class) IsSuperClassOf ¶ added in v1.7.0
c extends self
func (*Class) Loader ¶ added in v1.8.0
func (self *Class) Loader() *ClassLoader
func (Class) StaticVars ¶
func (*Class) SuperClass ¶ added in v1.7.0
type ClassLoader ¶
type ClassLoader struct {
// contains filtered or unexported fields
}
类加载器 类加载器依赖ClassPath来搜寻和读取class文件
func NewClassLoader ¶
func NewClassLoader(cp *classpath.Classpath, verboseFlag bool) *ClassLoader
创建一个加载器实例
func (*ClassLoader) LoadClass ¶
func (self *ClassLoader) LoadClass(name string) *Class
在classMap中根据name查询类 然后将将类数据加载到方法区中
type ClassMember ¶
type ClassMember struct {
// contains filtered or unexported fields
}
func (*ClassMember) IsPrivate ¶
func (self *ClassMember) IsPrivate() bool
func (*ClassMember) IsProtected ¶
func (self *ClassMember) IsProtected() bool
func (*ClassMember) IsPublic ¶
func (self *ClassMember) IsPublic() bool
type ConstantPool ¶
type ConstantPool struct {
// contains filtered or unexported fields
}
运行时常量池
func (*ConstantPool) GetConstant ¶
func (self *ConstantPool) GetConstant(index uint) Constant
根据索引返回常量
func (*ConstantPool) Name ¶
func (self *ConstantPool) Name() string
type Field ¶
type Field struct { ClassMember // contains filtered or unexported fields }
实例字段
func (Field) ConstValueIndex ¶
func (Field) Descriptor ¶
func (Field) IsLongOrDouble ¶
判断描述符是否属于J或者D,J -> long,D -> double 基本类型中,除了long的定义奇特外,其他都是基于首字母
type InterfaceMethodRef ¶
type InterfaceMethodRef struct { MemberRef // contains filtered or unexported fields }
接口方法的符号引用
func (InterfaceMethodRef) Descriptor ¶ added in v1.7.0
func (self InterfaceMethodRef) Descriptor() string
func (InterfaceMethodRef) Name ¶ added in v1.7.0
func (self InterfaceMethodRef) Name() string
func (*InterfaceMethodRef) ResolvedInterfaceMethod ¶ added in v1.7.0
func (self *InterfaceMethodRef) ResolvedInterfaceMethod() *Method
解析接口方法
type Method ¶
type Method struct { ClassMember // contains filtered or unexported fields }
func LookupMethodInClass ¶ added in v1.7.0
在类和父类中搜寻指定的方法
func (*Method) ArgSlotCount ¶ added in v1.7.0
func (Method) Descriptor ¶ added in v1.7.0
func (Method) IsAbstract ¶ added in v1.7.0
func (Method) MethodDescriptor ¶ added in v1.7.0
type MethodDescriptor ¶ added in v1.7.0
type MethodDescriptor struct {
// contains filtered or unexported fields
}
type MethodDescriptorParser ¶ added in v1.7.0
type MethodDescriptorParser struct {
// contains filtered or unexported fields
}
type MethodRef ¶
type MethodRef struct { MemberRef // contains filtered or unexported fields }
func (MethodRef) Descriptor ¶
func (*MethodRef) ResolvedMethod ¶ added in v1.7.0
解析非接口方法
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
java类对象,是所有Clas的父类
func InternString ¶ added in v1.9.0
func JString ¶ added in v1.8.1
func JString(loader *ClassLoader, goStr string) *Object
todo go string -> java.lang.String
func (*Object) ArrayLength ¶ added in v1.8.0
func (*Object) IsInstanceOf ¶
Source Files
¶
- access_flags.go
- array_class.go
- array_object.go
- class.go
- classMember.go
- class_hierarchy.go
- class_loader.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
- object.go
- slots.go
- string_pool.go
Click to show internal directories.
Click to hide internal directories.