Documentation
¶
Index ¶
- Constants
- type AccessFlag
- type Attribute
- type AttributeInfo
- type Attributes
- type ClassFile
- type CodeAttribute
- type ConstantPool
- type ConstantPoolEntry
- type ConstantValueAttribute
- type DoubleInfo
- type FieldInfo
- type FloatInfo
- type IndexConstant
- type InnerClassesAttribute
- type InnerClassesAttributeEntry
- type Interfaces
- type LinkConstant
- type LongInfo
- type MethodHandleInfo
- type MethodInfo
- type RIndexConstant
- type RLinkConstant
- type Reader
- func (r *Reader) Discard(length int64)
- func (r Reader) ReadAttributes(pool *ConstantPool) (*Attributes, error)
- func (r Reader) ReadCodeAttribute(pool *ConstantPool) (*CodeAttribute, error)
- func (r Reader) ReadConstantPool() (*ConstantPool, error)
- func (r Reader) ReadConstantValueAttribute() (*ConstantValueAttribute, error)
- func (r *Reader) ReadDouble() (float64, error)
- func (r *Reader) ReadDoubleTo(out *float64) error
- func (r Reader) ReadField(pool *ConstantPool) (*FieldInfo, error)
- func (r *Reader) ReadFloat() (float32, error)
- func (r *Reader) ReadFloatTo(out *float32) error
- func (r Reader) ReadInnerClassesAttribute(pool *ConstantPool) (*InnerClassesAttribute, error)
- func (r Reader) ReadInterfaces(pool *ConstantPool) (*Interfaces, error)
- func (r *Reader) ReadLong() (int64, error)
- func (r *Reader) ReadLongTo(out *int64) error
- func (r Reader) ReadSignatureAttribute(pool *ConstantPool) (*SignatureAttribute, error)
- func (r *Reader) ReadU1() (uint8, error)
- func (r *Reader) ReadU1To(out *uint8) error
- func (r *Reader) ReadU2() (uint16, error)
- func (r *Reader) ReadU2To(out *uint16) error
- func (r *Reader) ReadU4() (uint32, error)
- func (r *Reader) ReadU4To(out *uint32) error
- func (r *Reader) ReadUTF8() (string, error)
- type SignatureAttribute
- type Utf8Info
Constants ¶
View Source
const ( CodeAttr = "Code" InnerClassesAttr = "InnerClasses" ConstantValueAttr = "ConstantValue" SignatureAttr = "Signature" )
View Source
const ( ClassConstant uint8 = 7 FieldrefConstant = 9 MethodrefConstant = 10 InterfaceMethodrefConstant = 11 StringConstant = 8 IntegerConstant = 3 FloatConstant = 4 LongConstant = 5 DoubleConstant = 6 NameAndTypeConstant = 12 Utf8Constant = 1 MethodHandleConstant = 15 MethodTypeConstant = 16 InvokeDynamicConstant = 18 )
View Source
const ( PublicFieldACC AccessFlag = 0x0001 PrivateFieldACC = 0x0002 ProtectedFieldACC = 0x0004 StaticFieldACC = 0x0004 FinalFieldACC = 0x0008 VolatileFieldACC = 0x0010 TransientFieldACC = 0x0040 SyntheticFieldACC = 0x1000 EnumFieldACC = 0x4000 )
View Source
const ( PublicMethodACC AccessFlag = 0x0001 PrivateMethodACC = 0x0002 ProtectedMethodACC = 0x0004 StaticMethodACC = 0x0008 FinalMethodACC = 0x0010 SynchronizedMethodACC = 0x0020 BridgeMethodACC = 0x0040 VarargsMethodACC = 0x0080 NativeMethodACC = 0x0100 AbstractMethodACC = 0x0400 StrictMethodACC = 0x0800 SyntheticMethodACC = 0x1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessFlag ¶
type AccessFlag uint16
type AttributeInfo ¶
type Attributes ¶
type ClassFile ¶
type ClassFile struct { Magic uint32 MinorVersion uint16 MajorVersion uint16 ConstantPool *ConstantPool AccessFlags uint16 ThisClass uint16 SuperClass uint16 Interfaces *Interfaces FieldCount uint16 Fields []*FieldInfo MethodCount uint16 Methods []MethodInfo AttributeCount uint16 Attributes []AttributeInfo }
func ParseClassFile ¶
type CodeAttribute ¶
type CodeAttribute struct { LocalVariables uint16 CodeLength uint32 CodeFullLength uint16 Attributes *Attributes }
type ConstantPool ¶
type ConstantPool struct { Size uint16 Pool []*ConstantPoolEntry }
func (*ConstantPool) GetLinkConstant ¶
func (c *ConstantPool) GetLinkConstant(index uint16) (*RLinkConstant, error)
func (*ConstantPool) GetStringEntry ¶
func (c *ConstantPool) GetStringEntry(index uint16) (string, error)
type ConstantPoolEntry ¶
type ConstantPoolEntry struct { Tag uint8 Value interface{} }
type ConstantValueAttribute ¶
type ConstantValueAttribute struct {
Index uint16
}
type DoubleInfo ¶
type FieldInfo ¶
type FieldInfo struct { AccessFlags uint16 // See AccessFlag NameIndex uint16 DescriptorIndex uint16 AttributeCount uint16 Attributes []AttributeInfo }
type IndexConstant ¶
func (*IndexConstant) Resolve ¶
func (l *IndexConstant) Resolve(pool *ConstantPool) (*RIndexConstant, error)
type InnerClassesAttribute ¶
type InnerClassesAttribute struct { Size uint16 Entries []InnerClassesAttributeEntry }
type Interfaces ¶
type LinkConstant ¶
func (*LinkConstant) Resolve ¶
func (l *LinkConstant) Resolve(pool *ConstantPool) (*RLinkConstant, error)
type MethodHandleInfo ¶
type MethodInfo ¶
type MethodInfo struct { AccessFlags uint16 NameIndex uint16 DescriptorIndex uint16 AttributeCount uint16 Attributes []AttributeInfo }
type RIndexConstant ¶
type RLinkConstant ¶
type Reader ¶
func (Reader) ReadAttributes ¶
func (r Reader) ReadAttributes(pool *ConstantPool) (*Attributes, error)
func (Reader) ReadCodeAttribute ¶
func (r Reader) ReadCodeAttribute(pool *ConstantPool) (*CodeAttribute, error)
func (Reader) ReadConstantPool ¶
func (r Reader) ReadConstantPool() (*ConstantPool, error)
func (Reader) ReadConstantValueAttribute ¶
func (r Reader) ReadConstantValueAttribute() (*ConstantValueAttribute, error)
func (*Reader) ReadDouble ¶
func (*Reader) ReadDoubleTo ¶
func (*Reader) ReadFloatTo ¶
func (Reader) ReadInnerClassesAttribute ¶
func (r Reader) ReadInnerClassesAttribute(pool *ConstantPool) (*InnerClassesAttribute, error)
func (Reader) ReadInterfaces ¶
func (r Reader) ReadInterfaces(pool *ConstantPool) (*Interfaces, error)
func (*Reader) ReadLongTo ¶
func (Reader) ReadSignatureAttribute ¶
func (r Reader) ReadSignatureAttribute(pool *ConstantPool) (*SignatureAttribute, error)
type SignatureAttribute ¶
type SignatureAttribute struct {
Signature string
}
Click to show internal directories.
Click to hide internal directories.