classfile

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 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
)

Constant pool tags

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

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

func (*Annotation) Type

func (annotation *Annotation) Type() string

type ArrayValue

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

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 (self *AttributeTable) AnnotationDefaultAttributeData() []byte

func (*AttributeTable) BootstrapMethodsAttribute

func (self *AttributeTable) BootstrapMethodsAttribute() *BootstrapMethodsAttribute

func (*AttributeTable) CodeAttribute

func (self *AttributeTable) CodeAttribute() *CodeAttribute

func (*AttributeTable) ConstantValueAttribute

func (self *AttributeTable) ConstantValueAttribute() *ConstantValueAttribute

func (*AttributeTable) EnclosingMethodAttribute

func (self *AttributeTable) EnclosingMethodAttribute() *EnclosingMethodAttribute

func (*AttributeTable) ExceptionsAttribute

func (self *AttributeTable) ExceptionsAttribute() *ExceptionsAttribute

func (*AttributeTable) LineNumberTableAttribute

func (self *AttributeTable) LineNumberTableAttribute() *LineNumberTableAttribute

func (*AttributeTable) RuntimeVisibleAnnotationsAttributeData

func (self *AttributeTable) RuntimeVisibleAnnotationsAttributeData() *RuntimeVisibleAnnotationsAttribute

func (*AttributeTable) RuntimeVisibleParameterAnnotationsAttributeData

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

unparsed

func (*AttributeTable) SignatureAttribute

func (self *AttributeTable) SignatureAttribute() *SignatureAttribute

func (*AttributeTable) SourceFileAttribute

func (self *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 {
	ConstantPool ConstantPool
	AccessFlags  uint16

	Fields  []MemberInfo
	Methods []MemberInfo
	AttributeTable
	// 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) ClassName

func (self *ClassFile) ClassName() string

func (*ClassFile) InterfaceNames

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

func (*ClassFile) SuperClassName

func (self *ClassFile) SuperClassName() string

type ClassReader

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

type CodeAttribute

type CodeAttribute struct {
	MaxStack       uint16
	MaxLocals      uint16
	Code           []byte
	ExceptionTable []ExceptionTableEntry
	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];
}

type ConstantClassInfo

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

func (ConstantClassInfo) Name

func (self ConstantClassInfo) Name() string

type ConstantInfo

type ConstantInfo interface{}
cp_info {
    u1 tag;
    u1 info[];
}

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 (self ConstantInvokeDynamicInfo) BootstrapMethodInfo() (uint16, []uint16)

todo

func (ConstantInvokeDynamicInfo) NameAndType

func (self ConstantInvokeDynamicInfo) NameAndType() (string, string)

type ConstantMemberrefInfo

type ConstantMemberrefInfo struct {
	Tag uint8
	// contains filtered or unexported fields
}
CONSTANT_Fieldref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}
CONSTANT_Methodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}
CONSTANT_InterfaceMethodref_info {
    u1 tag;
    u2 class_index;
    u2 name_and_type_index;
}

func (ConstantMemberrefInfo) ClassName

func (self ConstantMemberrefInfo) ClassName() string

func (ConstantMemberrefInfo) NameAndDescriptor

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

type ConstantMethodHandleInfo

type ConstantMethodHandleInfo struct {
	ReferenceKind  uint8
	ReferenceIndex uint16
}
CONSTANT_MethodHandle_info {
    u1 tag;
    u1 reference_kind;
    u2 reference_index;
}

type ConstantMethodTypeInfo

type ConstantMethodTypeInfo struct {
	// contains filtered or unexported fields
}
CONSTANT_MethodType_info {
    u1 tag;
    u2 descriptor_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 {
	Infos []ConstantInfo
	// contains filtered or unexported fields
}

type ConstantStringInfo

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

func (ConstantStringInfo) String

func (self ConstantStringInfo) String() string

type ConstantValueAttribute

type ConstantValueAttribute struct {
	ConstantValueIndex uint16
}
ConstantValue_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 constantvalue_index;
}

type DeprecatedAttribute

type DeprecatedAttribute struct {
	MarkerAttribute
}
Deprecated_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
}

type ElementValue

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

type ElementValuePair

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

type EnclosingMethodAttribute

type EnclosingMethodAttribute struct {
	// contains filtered or unexported fields
}
EnclosingMethod_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 class_index;
    u2 method_index;
}

func (*EnclosingMethodAttribute) ClassName

func (self *EnclosingMethodAttribute) ClassName() string

func (*EnclosingMethodAttribute) MethodNameAndDescriptor

func (self *EnclosingMethodAttribute) MethodNameAndDescriptor() (string, string)

type EnumConstValue

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

type ExceptionTableEntry

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

type ExceptionsAttribute

type ExceptionsAttribute struct {
	ExceptionIndexTable []uint16
}
Exceptions_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 number_of_exceptions;
    u2 exception_index_table[number_of_exceptions];
}

type InnerClassInfo

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

type InnerClassesAttribute

type InnerClassesAttribute struct {
	// contains filtered or unexported fields
}
InnerClasses_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 number_of_classes;
    {   u2 inner_class_info_index;
        u2 outer_class_info_index;
        u2 inner_name_index;
        u2 inner_class_access_flags;
    } classes[number_of_classes];
}

type LineNumberTableAttribute

type LineNumberTableAttribute struct {
	// contains filtered or unexported fields
}
LineNumberTable_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 line_number_table_length;
    {   u2 start_pc;
        u2 line_number;
    } line_number_table[line_number_table_length];
}

func (*LineNumberTableAttribute) GetLineNumber

func (self *LineNumberTableAttribute) GetLineNumber(pc int) int

type LineNumberTableEntry

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

type LocalVariableTableAttribute

type LocalVariableTableAttribute struct {
	// contains filtered or unexported fields
}
LocalVariableTable_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 local_variable_table_length;
    {   u2 start_pc;
        u2 length;
        u2 name_index;
        u2 descriptor_index;
        u2 index;
    } local_variable_table[local_variable_table_length];
}

type LocalVariableTableEntry

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

type LocalVariableTypeTableAttribute

type LocalVariableTypeTableAttribute struct {
	// contains filtered or unexported fields
}
LocalVariableTypeTable_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 local_variable_type_table_length;
    {   u2 start_pc;
        u2 length;
        u2 name_index;
        u2 signature_index;
        u2 index;
    } local_variable_type_table[local_variable_type_table_length];
}

type LocalVariableTypeTableEntry

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

type MarkerAttribute

type MarkerAttribute struct{}

type MemberInfo

type MemberInfo struct {
	AccessFlags uint16

	AttributeTable
	// contains filtered or unexported fields
}
field_info {
    u2             access_flags;
    u2             name_index;
    u2             descriptor_index;
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}
method_info {
    u2             access_flags;
    u2             name_index;
    u2             descriptor_index;
    u2             attributes_count;
    attribute_info attributes[attributes_count];
}

func (*MemberInfo) ArgumentTypes added in v1.1.0

func (self *MemberInfo) ArgumentTypes() []string

func (*MemberInfo) Descriptor

func (self *MemberInfo) Descriptor() string

func (*MemberInfo) GetInvokeMethods added in v1.1.0

func (self *MemberInfo) GetInvokeMethods(params []string) []string

func (*MemberInfo) Name

func (self *MemberInfo) Name() string

func (*MemberInfo) Signature

func (self *MemberInfo) Signature() string

type RuntimeVisibleAnnotationsAttribute

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

func (*RuntimeVisibleAnnotationsAttribute) Annotations

func (runtimeVisibleAnnotationsAttribute *RuntimeVisibleAnnotationsAttribute) Annotations() []Annotation

type SignatureAttribute

type SignatureAttribute struct {
	// contains filtered or unexported fields
}
Signature_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 signature_index;
}

func (*SignatureAttribute) Signature

func (self *SignatureAttribute) Signature() string

type SourceFileAttribute

type SourceFileAttribute struct {
	// contains filtered or unexported fields
}
SourceFile_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 sourcefile_index;
}

func (*SourceFileAttribute) FileName

func (self *SourceFileAttribute) FileName() string

type SyntheticAttribute

type SyntheticAttribute struct {
	MarkerAttribute
}
Synthetic_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
}

type UnparsedAttribute

type UnparsedAttribute struct {
	Info []byte
	// contains filtered or unexported fields
}
attribute_info {
    u2 attribute_name_index;
    u4 attribute_length;
    u1 info[attribute_length];
}

Jump to

Keyboard shortcuts

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