cpool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ConstantClass = 7
View Source
const ConstantDouble = 6
View Source
const ConstantFieldref = 9
View Source
const ConstantFloat = 4
View Source
const ConstantInteger = 3
View Source
const ConstantInterfaceMethodref = 11
View Source
const ConstantInvokeDynamic = 18
View Source
const ConstantLong = 5
View Source
const ConstantMethodHandle = 15
View Source
const ConstantMethodType = 16
View Source
const ConstantMethodref = 10
View Source
const ConstantNameAndType = 12
View Source
const ConstantString = 8
View Source
const ConstantUtf8 = 1

Variables

This section is empty.

Functions

func TypeName

func TypeName(i interface{}) (name string)

TODO: find a better way to represent this

Types

type ConstBase

type ConstBase struct {
	// Index is the location in the constant pool for this constant
	Index uint16
	// Pool contains the constant pool for this constant and is used to lookup other constants in String()
	Pool ConstantPool
	// Tag is the constant pool tag which designates the type of constant
	Tag uint8
	// Type is the java spec type name
	Type string
}

ConstBase contains commonality across all constants in the constant pool

type ConstantClassInfo

type ConstantClassInfo struct {
	ConstBase
	NameIndex uint16
}

func ReadConstantClassInfo

func ReadConstantClassInfo(r PoolReader, index uint16) (c *ConstantClassInfo, err error)

func (*ConstantClassInfo) String

func (c *ConstantClassInfo) String() string

type ConstantDoubleInfo

type ConstantDoubleInfo struct {
	ConstBase
	Value float64
}

func ReadConstantDoubleInfo

func ReadConstantDoubleInfo(r PoolReader, index uint16) (cd *ConstantDoubleInfo, err error)

func (*ConstantDoubleInfo) String

func (c *ConstantDoubleInfo) String() string

type ConstantFieldrefInfo

type ConstantFieldrefInfo struct{ RefBase }

func ReadConstantFieldrefInfo

func ReadConstantFieldrefInfo(r PoolReader, index uint16) (fr *ConstantFieldrefInfo, err error)

func (*ConstantFieldrefInfo) String

func (c *ConstantFieldrefInfo) String() string

type ConstantFloatInfo

type ConstantFloatInfo struct {
	ConstBase
	Value float32
}

func ReadConstantFloatInfo

func ReadConstantFloatInfo(r PoolReader, index uint16) (cf *ConstantFloatInfo, err error)

func (*ConstantFloatInfo) String

func (c *ConstantFloatInfo) String() string

type ConstantIntegerInfo

type ConstantIntegerInfo struct {
	ConstBase
	Value int32
}

func ReadConstantIntegerInfo

func ReadConstantIntegerInfo(r PoolReader, index uint16) (ci *ConstantIntegerInfo, err error)

func (*ConstantIntegerInfo) String

func (c *ConstantIntegerInfo) String() string

type ConstantInterfaceMethodrefInfo

type ConstantInterfaceMethodrefInfo struct{ RefBase }

func ReadConstantInterfaceMethodrefInfo

func ReadConstantInterfaceMethodrefInfo(r PoolReader, index uint16) (imr *ConstantInterfaceMethodrefInfo, err error)

func (*ConstantInterfaceMethodrefInfo) String

func (imr *ConstantInterfaceMethodrefInfo) String() string

type ConstantInvokeDynamicInfo

type ConstantInvokeDynamicInfo struct {
	ConstBase
	BoostrapMethodAttrIndex uint16
	NameAndTypeIndex        uint16
}

func ReadConstantInvokeDynamicInfo

func ReadConstantInvokeDynamicInfo(r PoolReader, index uint16) (cid *ConstantInvokeDynamicInfo, err error)

type ConstantLongInfo

type ConstantLongInfo struct {
	ConstBase
	Value int64
}

func ReadConstantLongInfo

func ReadConstantLongInfo(r PoolReader, index uint16) (cl *ConstantLongInfo, err error)

func (*ConstantLongInfo) String

func (c *ConstantLongInfo) String() string

type ConstantMethodHandleInfo

type ConstantMethodHandleInfo struct {
	ConstBase
	ReferenceKind  uint8
	ReferenceIndex uint16
}

func ReadConstantMethodHandleInfo

func ReadConstantMethodHandleInfo(r PoolReader, index uint16) (mh *ConstantMethodHandleInfo, err error)

type ConstantMethodTypeInfo

type ConstantMethodTypeInfo struct {
	ConstBase
	DescriptorIndex uint16
}

func ReadConstantMethodTypeInfo

func ReadConstantMethodTypeInfo(r PoolReader, index uint16) (mt *ConstantMethodTypeInfo, err error)

type ConstantMethodrefInfo

type ConstantMethodrefInfo struct{ RefBase }

func ReadConstantMethodrefInfo

func ReadConstantMethodrefInfo(r PoolReader, index uint16) (mr *ConstantMethodrefInfo, err error)

func (*ConstantMethodrefInfo) String

func (mr *ConstantMethodrefInfo) String() string

type ConstantNameAndTypeInfo

type ConstantNameAndTypeInfo struct {
	ConstBase
	NameIndex       uint16
	DescriptorIndex uint16
}

func ReadConstantNameAndTypeInfo

func ReadConstantNameAndTypeInfo(r PoolReader, index uint16) (nat *ConstantNameAndTypeInfo, err error)

func (*ConstantNameAndTypeInfo) String

func (c *ConstantNameAndTypeInfo) String() string

type ConstantPool

type ConstantPool interface {
	Lookup(index uint16) interface{}
	Visit(func(interface{}))
	DebugOut()
}

ConstantPool breaks cyclic dependencies between packages TODO: this may not be needed anymore after recent refactoring

func Read

func Read(outerReader io.Reader) (cp ConstantPool, err error)

type ConstantStringInfo

type ConstantStringInfo struct {
	ConstBase
	StringIndex uint16
}

func ReadConstantStringInfo

func ReadConstantStringInfo(r PoolReader, index uint16) (cs *ConstantStringInfo, err error)

func (*ConstantStringInfo) String

func (c *ConstantStringInfo) String() string

type ConstantUtf8Info

type ConstantUtf8Info struct {
	ConstBase
	Value string
}

TODO: this probably does not need to be anything other than a string

func ReadConstantUtf8Info

func ReadConstantUtf8Info(r PoolReader, index uint16) (u *ConstantUtf8Info, err error)

func (*ConstantUtf8Info) String

func (c *ConstantUtf8Info) String() string

type PoolReader

type PoolReader struct {
	io.Reader
	ConstantPool
}

PoolReader combines the current reader and a reference to the constant pool

type RefBase

type RefBase struct {
	ConstBase
	ClassIndex       uint16
	NameAndTypeIndex uint16
}

func (*RefBase) ClassName

func (rb *RefBase) ClassName() string

func (*RefBase) ReadRefBaseIndexes

func (rb *RefBase) ReadRefBaseIndexes(r io.Reader) (err error)

Jump to

Keyboard shortcuts

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