classfile

package
v0.0.0-...-396a858 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 5 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
}
attribute_info {
    u2 attribute_name_index;
    u4 attribute_length;
    u1 info[attribute_length];
}

type AttributeTable

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

func (*AttributeTable) AnnotationDefaultAttributeData

func (table *AttributeTable) AnnotationDefaultAttributeData() []byte

func (*AttributeTable) BootstrapMethodsAttribute

func (table *AttributeTable) BootstrapMethodsAttribute() *BootstrapMethodsAttribute

func (*AttributeTable) CodeAttribute

func (table *AttributeTable) CodeAttribute() *CodeAttribute

func (*AttributeTable) ConstantValueAttribute

func (table *AttributeTable) ConstantValueAttribute() *ConstantValueAttribute

group 1

func (*AttributeTable) EnclosingMethodAttribute

func (table *AttributeTable) EnclosingMethodAttribute() *EnclosingMethodAttribute

func (*AttributeTable) ExceptionsAttribute

func (table *AttributeTable) ExceptionsAttribute() *ExceptionsAttribute

func (*AttributeTable) LineNumberTableAttribute

func (table *AttributeTable) LineNumberTableAttribute() *LineNumberTableAttribute

func (*AttributeTable) RuntimeVisibleAnnotationsAttributeData

func (table *AttributeTable) RuntimeVisibleAnnotationsAttributeData() []byte

func (*AttributeTable) RuntimeVisibleParameterAnnotationsAttributeData

func (table *AttributeTable) RuntimeVisibleParameterAnnotationsAttributeData() []byte

func (*AttributeTable) SignatureAttribute

func (table *AttributeTable) SignatureAttribute() *SignatureAttribute

func (*AttributeTable) SourceFileAttribute

func (table *AttributeTable) SourceFileAttribute() *SourceFileAttribute

type BootstrapMethod

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

type BootstrapMethodsAttribute

type BootstrapMethodsAttribute struct {
	// contains filtered or unexported fields
}
BootstrapMethods_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 num_bootstrap_methods;
    {   u2 bootstrap_method_ref;
        u2 num_bootstrap_arguments;
        u2 bootstrap_arguments[num_bootstrap_arguments];
    } bootstrap_methods[num_bootstrap_methods];
}

type ClassFile

type ClassFile struct {
	AttributeTable
	// contains filtered or unexported fields
}

ClassFile represents a java class file structure

type ClassFileParser

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

func (*ClassFileParser) Parse

func (parser *ClassFileParser) Parse() (*ClassFile, error)

Parse parses content of a class file and tries to return a parsed class file or error if failure

type ClassParser

type ClassParser interface {
	Parse() (*ClassFile, error)
}

func NewParser

func NewParser(content []byte) ClassParser

NewParser creates a new class file reader

type CodeAttribute

type CodeAttribute struct {
	AttributeTable
	// 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 (attr *CodeAttribute) Code() []byte

func (*CodeAttribute) ExceptionTable

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

func (*CodeAttribute) MaxLocals

func (attr *CodeAttribute) MaxLocals() uint

func (*CodeAttribute) MaxStack

func (attr *CodeAttribute) MaxStack() uint

type ConstantClassInfo

type ConstantClassInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Class_info {
    u1 tag;
    u2 name_index;
}

func (*ConstantClassInfo) Name

func (info *ConstantClassInfo) Name() string

type ConstantDoubleInfo

type ConstantDoubleInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Double_info {
    u1 tag;
    u4 high_bytes;
    u4 low_bytes;
}

func (*ConstantDoubleInfo) Value

func (info *ConstantDoubleInfo) Value() float64

type ConstantFieldrefInfo

type ConstantFieldrefInfo struct {
	ConstantMemberrefInfo
}
CONSTANT_Fieldref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantFloatInfo

type ConstantFloatInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Float_info {
    u1 tag;
    u4 bytes;
}

func (*ConstantFloatInfo) Value

func (info *ConstantFloatInfo) Value() float32

type ConstantInfo

type ConstantInfo interface {
	// contains filtered or unexported methods
}
cp_info {
    u1 tag;
    u1 info[];
}

type ConstantIntegerInfo

type ConstantIntegerInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Integer_info {
    u1 tag;
    u4 bytes;
}

func (*ConstantIntegerInfo) Value

func (info *ConstantIntegerInfo) Value() int32

type ConstantInterfaceMethodrefInfo

type ConstantInterfaceMethodrefInfo struct {
	ConstantMemberrefInfo
}
CONSTANT_InterfaceMethodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantInvokeDynamicInfo

type ConstantInvokeDynamicInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_InvokeDynamic_info {
    u1 tag;
    u2 bootstrap_method_attr_index;
    u2 name_and_type_index;
}

func (*ConstantInvokeDynamicInfo) BootstrapMethodInfo

func (info *ConstantInvokeDynamicInfo) BootstrapMethodInfo() (uint16, []uint16)

func (*ConstantInvokeDynamicInfo) NameAndType

func (info *ConstantInvokeDynamicInfo) NameAndType() (string, string)

type ConstantLongInfo

type ConstantLongInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_Long_info {
    u1 tag;
    u4 high_bytes;
    u4 low_bytes;
}

func (*ConstantLongInfo) Value

func (info *ConstantLongInfo) Value() int64

type ConstantMemberrefInfo

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

func (*ConstantMemberrefInfo) ClassName

func (info *ConstantMemberrefInfo) ClassName() string

func (*ConstantMemberrefInfo) NameAndDescriptor

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

type ConstantMethodHandleInfo

type ConstantMethodHandleInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_MethodHandle_info {
    u1 tag;
    u1 reference_kind;
    u2 reference_index;
}

func (*ConstantMethodHandleInfo) ReferenceIndex

func (info *ConstantMethodHandleInfo) ReferenceIndex() uint16

func (*ConstantMethodHandleInfo) ReferenceKind

func (info *ConstantMethodHandleInfo) ReferenceKind() uint8

type ConstantMethodTypeInfo

type ConstantMethodTypeInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_MethodType_info {
    u1 tag;
    u2 descriptor_index;
}

type ConstantMethodrefInfo

type ConstantMethodrefInfo struct {
	ConstantMemberrefInfo
}
CONSTANT_Methodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

type ConstantNameAndTypeInfo

type ConstantNameAndTypeInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_NameAndType_info {
    u1 tag;
    u2 name_index;
    u2 descriptor_index;
}

type ConstantPool

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

func (*ConstantPool) Infos

func (pool *ConstantPool) Infos() []ConstantInfo

type ConstantStringInfo

type ConstantStringInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_String_info {
    u1 tag;
    u2 string_index;
}

func (*ConstantStringInfo) String

func (info *ConstantStringInfo) String() string

type ConstantUtf8Info

type ConstantUtf8Info struct {
	// contains filtered or unexported fields
}
CONSTANT_Utf8_info {
    u1 tag;
    u2 length;
    u1 bytes[length];
}

func (*ConstantUtf8Info) Str

func (info *ConstantUtf8Info) Str() string

type ContentReader

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

func NewContentReader

func NewContentReader(content []byte) *ContentReader

type ExceptionTableEntry

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

func (*ExceptionTableEntry) CatchType

func (attr *ExceptionTableEntry) CatchType() uint16

func (*ExceptionTableEntry) EndPc

func (attr *ExceptionTableEntry) EndPc() uint16

func (*ExceptionTableEntry) HandlerPc

func (attr *ExceptionTableEntry) HandlerPc() uint16

func (*ExceptionTableEntry) StartPc

func (attr *ExceptionTableEntry) StartPc() uint16

type MemberInfo

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

MemberInfo represents either a field or method in a class

func (*MemberInfo) AccessFlags

func (member *MemberInfo) AccessFlags() uint16

func (*MemberInfo) Descriptor

func (member *MemberInfo) Descriptor() string

func (*MemberInfo) Name

func (member *MemberInfo) Name() string

func (*MemberInfo) Signature

func (member *MemberInfo) Signature() string

Jump to

Keyboard shortcuts

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