Documentation
¶
Index ¶
- Constants
- func ArrayCopy(src, dest *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) 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) IsAssignableFrom(other *Class) 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) 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) Methods() []*Method
- 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) SourceFile() string
- 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 ExceptionHandler
- type ExceptionTable
- type Field
- type FieldRef
- type InterfaceMethodRef
- type MemberRef
- type Method
- func (self *Method) ArgSlotCount() uint
- func (self *Method) Code() []byte
- func (self *Method) FindExceptionHandler(exClass *Class, pc int) int
- func (self *Method) GetLineNumber(pc int) int
- 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 (method *Method) MaxLocals() uint
- func (method *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 { //实例变量(及private String name)占据的空间大小 InstanceSlotCount uint // contains filtered or unexported fields }
*
我们需要注意一下JVM中的class 我们这里的class,是运行时常量池里的class 我们的java.lang.Class 继承 java.lang.Object java.lang.Object.class 又需要有一个 java.lang.Class(java.lang.Object.class 是存放在堆内存中的,相当于java.lang.Class的实例) 那么问题来了,是现有的java.lang.Object还是先有的java.lang.Class 这种问题,非常类似于spring解决set方式的循环依赖,都是通过在“混沌态”的时候解决问题。 JVM也是这样的,在这两个class在运行时常量池中还没完全初始化的时候,暴露出引用,来解决这个问题,这样我们就有了java世界里最最基础的两个class
*
func (*Class) ArrayClass ¶
func (*Class) ComponentClass ¶
func (*Class) GetClinitMethod ¶
func (*Class) GetInstanceMethod ¶
func (*Class) GetMainMethod ¶
func (*Class) GetPackageName ¶
func (*Class) InitStarted ¶
func (*Class) IsAbstract ¶
func (*Class) IsAnnotation ¶
func (*Class) IsImplements ¶
self implements iface
func (*Class) IsInterface ¶
func (*Class) IsSuperClassOf ¶
other extends self
func (*Class) IsSynthetic ¶
func (*Class) Loader ¶
func (self *Class) Loader() *ClassLoader
func (*Class) SourceFile ¶
func (*Class) StaticVars ¶
func (*Class) SuperClass ¶
type ClassLoader ¶
type ClassLoader struct {
// contains filtered or unexported fields
}
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
}
*
存放字段和方法公有的信息
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 ExceptionHandler ¶
type ExceptionHandler struct {
// contains filtered or unexported fields
}
*
异常处理器
type ExceptionTable ¶
type ExceptionTable []*ExceptionHandler
type Field ¶
type Field struct { //继承自ClassMember,字段和方法都属于类的成员 ClassMember // contains filtered or unexported fields }
func (*Field) ConstValueIndex ¶
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,字段和方法都属于类的成员 ClassMember // contains filtered or unexported fields }
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 JString ¶
func JString(loader *ClassLoader, goStr string) *Object
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
- costant_pool.go
- cp_classref.go
- cp_fieldref.go
- cp_interface_methodref.go
- cp_memberref.go
- cp_methodref.go
- cp_symref.go
- exception_table.go
- field.go
- method.go
- method_descriptor.go
- method_descriptor_parser.go
- object.go
- object_clone.go
- slots.go
- string_pool.go
Click to show internal directories.
Click to hide internal directories.