classfile

package
v0.0.0-...-eae4ae3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONSTANT_Class              = 7
	CONSTANT_Fieldref           = 9
	CONSTANT_Methodref          = 10
	CONSTANT_InterfaceMethodref = 11
	CONSTANT_String             = 8
	CONSTANT_Integer            = 3
	CONSTANT_Float              = 4
	CONSTANT_Long               = 5
	CONSTANT_Double             = 6
	CONSTANT_NameAndType        = 12
	CONSTANT_Utf8               = 1
	CONSTANT_MethodHandle       = 15
	CONSTANT_MethodType         = 16
	CONSTANT_InvokeDynamic      = 18
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeInfo

type AttributeInfo interface {
	// contains filtered or unexported methods
}

type ClassFile

type ClassFile struct {
	// contains filtered or unexported fields
}
ClassFile {
    u4             magic;
    u2             minor_version;
    u2             major_version;
    u2             constant_pool_count;
    cp_info        constant_pool[constant_pool_count-1];
    u2             access_flags;
    u2             this_class;
    u2             super_class;
    u2             interfaces_count;
    u2             interfaces[interfaces_count];
    u2             fields_count;
    field_info     fields[fields_count];
    u2             methods_count;
    method_info    methods[methods_count];
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}

func Parse

func Parse(classData []byte) (cf *ClassFile, err error)

func (*ClassFile) AccessFlags

func (self *ClassFile) AccessFlags() uint16

func (*ClassFile) ClassName

func (self *ClassFile) ClassName() string

func (*ClassFile) ConstantPool

func (self *ClassFile) ConstantPool() ConstantPool

func (*ClassFile) Fields

func (self *ClassFile) Fields() []*MemberInfo

func (*ClassFile) InterfaceNames

func (self *ClassFile) InterfaceNames() []string

func (*ClassFile) MajorVersion

func (self *ClassFile) MajorVersion() uint16

func (*ClassFile) Methods

func (self *ClassFile) Methods() []*MemberInfo

func (*ClassFile) MinorVersion

func (self *ClassFile) MinorVersion() uint16

func (*ClassFile) SuperClassName

func (self *ClassFile) SuperClassName() string

type ClassReader

type ClassReader struct {
	// contains filtered or unexported fields
}

type CodeAttribute

type CodeAttribute struct {
	// contains filtered or unexported fields
}
Code_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 max_stack;
    u2 max_locals;
    u4 code_length;
    u1 code[code_length];
    u2 exception_table_length;
    {   u2 start_pc;
        u2 end_pc;
        u2 handler_pc;
        u2 catch_type;
    } exception_table[exception_table_length];
    u2 attributes_count;
    attribute_info attributes[attributes_count];
}

func (*CodeAttribute) Code

func (self *CodeAttribute) Code() []byte

func (*CodeAttribute) ExceptionTable

func (self *CodeAttribute) ExceptionTable() []*ExceptionTableEntry

func (*CodeAttribute) MaxLocals

func (self *CodeAttribute) MaxLocals() uint

func (*CodeAttribute) MaxStack

func (self *CodeAttribute) MaxStack() uint

type ConstantClassInfo

type ConstantClassInfo struct {
	// contains filtered or unexported fields
}

func (*ConstantClassInfo) Name

func (self *ConstantClassInfo) Name() string

type ConstantDoubleInfo

type ConstantDoubleInfo struct {
	// contains filtered or unexported fields
}

type ConstantFieldrefInfo

type ConstantFieldrefInfo struct {
	ConstantMemberrefInfo
}

type ConstantFloatInfo

type ConstantFloatInfo struct {
	// contains filtered or unexported fields
}

type ConstantInfo

type ConstantInfo interface {
	// contains filtered or unexported methods
}

type ConstantIntegerInfo

type ConstantIntegerInfo struct {
	// contains filtered or unexported fields
}

type ConstantInterfaceMethodrefInfo

type ConstantInterfaceMethodrefInfo struct {
	ConstantMemberrefInfo
}

type ConstantInvokeDynamicInfo

type ConstantInvokeDynamicInfo struct {
	// contains filtered or unexported fields
}

type ConstantLongInfo

type ConstantLongInfo struct {
	// contains filtered or unexported fields
}

type ConstantMemberrefInfo

type ConstantMemberrefInfo struct {
	// contains filtered or unexported fields
}

func (*ConstantMemberrefInfo) ClassName

func (self *ConstantMemberrefInfo) ClassName() string

func (*ConstantMemberrefInfo) NameAndDescriptor

func (self *ConstantMemberrefInfo) NameAndDescriptor() (string, string)

type ConstantMethodHandleInfo

type ConstantMethodHandleInfo struct {
	// contains filtered or unexported fields
}

type ConstantMethodTypeInfo

type ConstantMethodTypeInfo struct {
	// contains filtered or unexported fields
}

type ConstantMethodrefInfo

type ConstantMethodrefInfo struct {
	ConstantMemberrefInfo
}

type ConstantNameAndTypeInfo

type ConstantNameAndTypeInfo struct {
	// contains filtered or unexported fields
}

type ConstantPool

type ConstantPool []ConstantInfo

type ConstantStringInfo

type ConstantStringInfo struct {
	// contains filtered or unexported fields
}

func (*ConstantStringInfo) String

func (self *ConstantStringInfo) String() string

type ConstantUtf8Info

type ConstantUtf8Info struct {
	// contains filtered or unexported fields
}

func (*ConstantUtf8Info) Str

func (self *ConstantUtf8Info) Str() string

type ConstantValueAttribute

type ConstantValueAttribute struct {
	// contains filtered or unexported fields
}

func (*ConstantValueAttribute) ConstantValueIndex

func (self *ConstantValueAttribute) ConstantValueIndex() uint16

type DeprecatedAttribute

type DeprecatedAttribute struct {
	MarkerAttribute
}

type ExceptionTableEntry

type ExceptionTableEntry struct {
	// contains filtered or unexported fields
}

func (*ExceptionTableEntry) CatchType

func (self *ExceptionTableEntry) CatchType() uint16

func (*ExceptionTableEntry) EndPc

func (self *ExceptionTableEntry) EndPc() uint16

func (*ExceptionTableEntry) HandlerPc

func (self *ExceptionTableEntry) HandlerPc() uint16

func (*ExceptionTableEntry) StartPc

func (self *ExceptionTableEntry) StartPc() uint16

type ExceptionsAttribute

type ExceptionsAttribute struct {
	// contains filtered or unexported fields
}

func (*ExceptionsAttribute) ExceptionsAttribute

func (self *ExceptionsAttribute) ExceptionsAttribute() []uint16

type LineNumberTableAttribute

type LineNumberTableAttribute struct {
	// contains filtered or unexported fields
}

type LineNumberTableEntry

type LineNumberTableEntry struct {
	// contains filtered or unexported fields
}

type LocalVariableTableAttribute

type LocalVariableTableAttribute struct {
	// contains filtered or unexported fields
}

type LocalVariableTableEntry

type LocalVariableTableEntry struct {
	// contains filtered or unexported fields
}

type MarkerAttribute

type MarkerAttribute struct{}

type MemberInfo

type MemberInfo struct {
	// contains filtered or unexported fields
}

func (*MemberInfo) AccessFlags

func (self *MemberInfo) AccessFlags() uint16

func (*MemberInfo) CodeAttribute

func (self *MemberInfo) CodeAttribute() *CodeAttribute

func (*MemberInfo) Descriptor

func (self *MemberInfo) Descriptor() string

func (*MemberInfo) Name

func (self *MemberInfo) Name() string

type SourceFileAttribute

type SourceFileAttribute struct {
	// contains filtered or unexported fields
}

func (*SourceFileAttribute) FileName

func (self *SourceFileAttribute) FileName() string

type SyntheticAttribute

type SyntheticAttribute struct {
	MarkerAttribute
}

type UnparsedAttribute

type UnparsedAttribute struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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