entity

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClassPublic     = 0x1
	ClassPrivate    = 0x2
	ClassProtected  = 0x4
	ClassStatic     = 0x8
	ClassFinal      = 0x10
	ClassInterface  = 0x200
	ClassAbstract   = 0x400
	ClassSynthetic  = 0x1000
	ClassAnnotation = 0x2000
	ClassEnum       = 0x4000
)
View Source
const (
	ConstantClass              byte = 7
	ConstantFieldref           byte = 9
	ConstantMethodref          byte = 10
	ConstantInterfacemethodref byte = 11
	ConstantString             byte = 8
	ConstantInteger            byte = 3
	ConstantFloat              byte = 4
	ConstantLong               byte = 5
	ConstantDouble             byte = 6
	ConstantNameandtype        byte = 12
	ConstantUtf8               byte = 1
	CONSTANT_MethodHandle      byte = 15
	CONSTANT_MethodType        byte = 16
	CONSTANT_InvokeDynamic     byte = 18
)
View Source
const (
	MethodPublic       = 0x1
	MethodPrivate      = 0x2
	MethodProtected    = 0x4
	MethodStatic       = 0x8
	MethodFinal        = 0x10
	MethodSynchronized = 0x20
	MethodBridge       = 0x40
	MethodVarargs      = 0x100
	MethodAbstract     = 0x0400
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name  string
	Bytes []byte
}

type ByteCode

type ByteCode struct {
	MaxStack       uint16
	MaxLocals      uint16
	Text           []byte
	ExceptionTable []Exception
}

type Class

type Class struct {
	Name      string
	Methods   map[string][]*Method
	Constants *ConstPool
	Super     string
	Flags     uint16
	// contains filtered or unexported fields
}

func (*Class) GetStaticField

func (c *Class) GetStaticField(name string) interface{}

func (*Class) IsPublic

func (c *Class) IsPublic() bool

func (*Class) SetStaticField

func (c *Class) SetStaticField(name string, value interface{})

type ConstPool

type ConstPool struct {
	Consts []interface{}
}

func (*ConstPool) GetClassName

func (p *ConstPool) GetClassName(idx uint16) string

GetClassName get a class name from constant pool by its index

func (*ConstPool) GetConst

func (p *ConstPool) GetConst(idx uint16) interface{}

func (*ConstPool) GetFieldRef

func (p *ConstPool) GetFieldRef(idx uint16) (class string, name string, desc string)

GetFieldRef get the class, name and description of a field, from its index in constant pool

func (*ConstPool) GetInterfaceMethodRef

func (p *ConstPool) GetInterfaceMethodRef(idx uint16) (class string, name string, desc string)

GetInterfaceMethodRef get the class, name and description of an interface method, from its index in constant pool

func (*ConstPool) GetMethodRef

func (p *ConstPool) GetMethodRef(idx uint16) (class string, name string, desc string)

GetMethodRef get the class, name and description of a method, from its index in constant pool

func (*ConstPool) GetNameType

func (p *ConstPool) GetNameType(idx uint16) (name string, desc string)

func (*ConstPool) GetUtf8Const

func (p *ConstPool) GetUtf8Const(idx uint16) string

GetUtf8Const get an utf8 constant from constant pool by its index

type Exception

type Exception struct {
	StartPc   uint16
	EndPc     uint16
	HandlerPc uint16
	CatchType uint16
}

type Method

type Method struct {
	Name  string
	Flags uint16
	Desc  string
	Attrs []Attribute
	This  *Class
}

func (*Method) IsFinal

func (m *Method) IsFinal() bool

func (*Method) IsPublic

func (m *Method) IsPublic() bool

func (*Method) IsStatic

func (m *Method) IsStatic() bool

type NameType

type NameType struct {
	NameIdx uint16
	DescIdx uint16
}

type Object

type Object struct {
	Proto *Class
	Data  map[string]interface{}
}

func CreateObject

func CreateObject(Proto *Class) *Object

func (*Object) Get

func (o *Object) Get(name string) interface{}

func (*Object) Set

func (o *Object) Set(name string, value interface{})

type Ref

type Ref struct {
	// TODO: Cache here
	ClassIdx    uint16
	NameTypeIdx uint16
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL