class

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConstantUtf8Info               = 1
	ConstantIntegerInfo            = 3
	ConstantFloatInfo              = 4
	ConstantLongInfo               = 5
	ConstantDoubleInfo             = 6
	ConstantClassInfo              = 7
	ConstantStringInfo             = 8
	ConstantFieldRefInfo           = 9
	ConstantMethodRefInfo          = 10
	ConstantInterfaceMethodRefInfo = 11
	ConstantNameAndTypeInfo        = 12
	ConstantMethodHandleInfo       = 15
	ConstantMethodTypeInfo         = 16
	ConstantDynamicInfo            = 17
	ConstantInvokeDynamicInfo      = 18
	ConstantModuleInfo             = 19
	ConstantPackageInfo            = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation added in v1.5.0

type Annotation struct {
	TypeIndex         uint16
	ElementValuePairs []*ElementValuePair
}

func NewAnnotation added in v1.5.0

func NewAnnotation(stream *commons.Stream) (*Annotation, error)

type AttrAccessFlag added in v1.5.0

type AttrAccessFlag uint16
const (
	AttrAccPublic       AttrAccessFlag = 0x0001 // Declared public; may be accessed from outside its package.
	AttrAccPrivate      AttrAccessFlag = 0x0002 // Declared private; accessible only within the defining class and other classes belonging to the same nest (§5.4.4).
	AttrAccProtected    AttrAccessFlag = 0x0004 // Declared protected; may be accessed within subclasses.
	AttrAccStatic       AttrAccessFlag = 0x0008 // Declared static.
	AttrAccFinal        AttrAccessFlag = 0x0010 // Declared final; must not be overridden (§5.4.5).
	AttrAccSynchronized AttrAccessFlag = 0x0020 // Declared synchronized; invocation is wrapped by a monitor use.
	AttrAccBridge       AttrAccessFlag = 0x0040 // A bridge method, generated by the compiler.
	AttrAccVarargs      AttrAccessFlag = 0x0080 // Declared with variable number of arguments.
	AttrAccNative       AttrAccessFlag = 0x0100 // Declared native; implemented in a language other than the Java programming language.
	AttrAccAbstract     AttrAccessFlag = 0x0400 // Declared abstract; no implementation is provided.
	AttrAccStrict       AttrAccessFlag = 0x0800 // In a class file whose major version number is at least 46 and at most 60: Declared strictfp.
	AttrAccSynthetic    AttrAccessFlag = 0x1000 // Declared synthetic; not present in the source code.
)

func (AttrAccessFlag) HasAccessFlag added in v1.5.0

func (aaf AttrAccessFlag) HasAccessFlag(flag AttrAccessFlag) bool

type AttrAnnotationDefault added in v1.5.0

type AttrAnnotationDefault struct {
	*AttributeBase

	DefaultValue *ElementValue
}

type AttrBootstrapMethods added in v1.5.0

type AttrBootstrapMethods struct {
	*AttributeBase

	BootstrapMethods []*BootstrapMethod
}

AttrBootstrapMethods https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.23

type AttrCode

type AttrCode struct {
	*AttributeBase

	// Maximum depth of the operand stack of this method at any point during execution of the method.
	MaxStack uint16

	// The number of local variables in the local variable array allocated upon invocation of this method,
	//   including the local variables used to pass parameters to the method on its invocation.
	MaxLocals uint16

	// Actual bytes of Java Virtual Machine code that implement the method
	// If the method is either native or abstract, and is not a class or interface initialization method,
	//   then its Method structure must not have a Code attribute in its attributes table.
	//   Otherwise, its Method structure must have exactly one Code attribute in its attributes table.
	Code []byte

	// Each entry in the ExceptionTable array describes one exception handler in the code array.
	//   The order of the handlers in the ExceptionTable array is significant
	ExceptionTable []*Exception

	// Attributes related to AttrCode
	Attributes []Attribute
}

AttrCode attribute of Method https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.3

type AttrConstValue

type AttrConstValue struct {
	*AttributeBase

	// indicate the index of the constant value
	// one of ConstantInteger, ConstantFloat, ConstantDouble, ConstantString, ConstantLong
	ConstantValueIndex uint16
}

AttrConstValue attribute of Field https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.2

type AttrEnclosingMethod

type AttrEnclosingMethod struct {
	*AttributeBase

	// The value of the class_index item must be a valid index into the constant_pool table.
	ClassIndex uint16

	// The value of the method_index item must be a valid index into the constant_pool table
	MethodIndex uint16
}

AttrEnclosingMethod https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.7

type AttrExceptions

type AttrExceptions struct {
	*AttributeBase

	// Each value in the exception_index_table array must be a valid index into the constant_pool table.
	// The constant_pool entry at that index must be a CONSTANT_Class_info structure (§4.4.1) representing
	//  a class type that this method is declared to throw.
	ExceptionIndexes []uint16
}

AttrExceptions https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.5

type AttrInnerClasses added in v1.5.0

type AttrInnerClasses struct {
	*AttributeBase

	InnerClasses []*InnerClass
}

AttrInnerClasses https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.6

type AttrLocalVariableTable

type AttrLocalVariableTable struct {
	*AttributeBase

	Tables []*LocalVariableTable
}

type AttrLocalVariableTypeTable

type AttrLocalVariableTypeTable struct {
	*AttributeBase

	Tables []*LocalVariableTypeTable
}

AttrLocalVariableTypeTable https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.14

type AttrMethodParameters added in v1.5.0

type AttrMethodParameters struct {
	*AttributeBase

	Parameters []*MethodParameter
}

AttrMethodParameters https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.24

type AttrModule added in v1.5.0

type AttrModule struct {
	*AttributeBase

	ModuleName         uint16
	ModuleFlags        uint16
	ModuleVersionIndex uint16

	Requires  []*ModuleRequires
	Exports   []*ModuleExports
	Opens     []*ModuleOpens
	UsesIndex []uint16
	Provides  []*ModuleProvides
}

AttrModule https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.25

type AttrModuleMainClass added in v1.5.0

type AttrModuleMainClass struct {
	*AttributeBase

	MainClassIndex uint16
}

AttrModuleMainClass https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.27

type AttrModulePackages added in v1.5.0

type AttrModulePackages struct {
	*AttributeBase

	PackageIndex []uint16
}

AttrModulePackages https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.26

type AttrNestHost added in v1.5.0

type AttrNestHost struct {
	*AttributeBase

	// The value of the host_class_index item must be a valid index into the constant_pool table.
	//  The constant_pool entry at that index must be a CONSTANT_Class_info structure (§4.4.1) representing a class or interface which is the nest host for the current class or interface.
	HostClassIndex uint16
}

AttrNestHost https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.28

type AttrNestMembers added in v1.5.0

type AttrNestMembers struct {
	*AttributeBase
	// contains filtered or unexported fields
}

AttrNestMembers https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.29

type AttrPermittedSubclasses added in v1.5.0

type AttrPermittedSubclasses struct {
	*AttributeBase
	// contains filtered or unexported fields
}

AttrPermittedSubclasses https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.31

type AttrRecord added in v1.5.0

type AttrRecord struct {
	*AttributeBase

	Components []*RecordComponentInfo
}

AttrRecord https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.3

type AttrRuntimeInvisibleAnnotations added in v1.5.0

type AttrRuntimeInvisibleAnnotations struct {
	*AttributeBase

	Annotations []*Annotation
}

AttrRuntimeInvisibleAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.17

type AttrRuntimeInvisibleParameterAnnotations added in v1.5.0

type AttrRuntimeInvisibleParameterAnnotations struct {
	*AttributeBase

	Parameters []*ParameterAnnotation
}

AttrRuntimeInvisibleParameterAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.19

type AttrRuntimeInvisibleTypeAnnotations added in v1.5.0

type AttrRuntimeInvisibleTypeAnnotations struct {
	*AttributeBase

	Annotations []*TypeAnnotation
}

AttrRuntimeInvisibleTypeAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.21

type AttrRuntimeVisibleAnnotations added in v1.5.0

type AttrRuntimeVisibleAnnotations struct {
	*AttributeBase

	Annotations []*Annotation
}

AttrRuntimeVisibleAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.16

type AttrRuntimeVisibleParameterAnnotations added in v1.5.0

type AttrRuntimeVisibleParameterAnnotations struct {
	*AttributeBase

	Parameters []*ParameterAnnotation
}

AttrRuntimeVisibleParameterAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.18

type AttrRuntimeVisibleTypeAnnotations added in v1.5.0

type AttrRuntimeVisibleTypeAnnotations struct {
	*AttributeBase

	Annotations []*TypeAnnotation
}

AttrRuntimeVisibleTypeAnnotations https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.20

type AttrSignature

type AttrSignature struct {
	*AttributeBase

	// The value of the SignatureIndex item must be a valid index into the constant_pool table.
	SignatureIndex uint16
}

AttrSignature https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.9

type AttrSourceDebugExtension

type AttrSourceDebugExtension struct {
	*AttributeBase

	// The DebugExtension array holds extended debugging information which has no semantic effect on the Java Virtual Machine.
	DebugExtension []byte
}

AttrSourceDebugExtension https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.11

type AttrSourceFile

type AttrSourceFile struct {
	*AttributeBase
	SourceFileIndex uint16 // indicate the name of the source file of the class
}

AttrSourceFile attribute of ClassFile https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.10

type AttrStackMapTable

type AttrStackMapTable struct {
	*AttributeBase

	Data []byte
}

The AttrStackMapTable attribute is a variable-length attribute in the attributes table of a Code attribute. A AttrStackMapTable attribute is used during the process of verification by type checking.

type Attribute

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

type AttributeBase

type AttributeBase struct {
	AttributeNameIndex uint16
	AttributeLength    uint32
	// contains filtered or unexported fields
}

type BootstrapMethod added in v1.5.0

type BootstrapMethod struct {
	// The value of the bootstrap_method_ref item must be a valid index into the constant_pool table.
	//  The constant_pool entry at that index must be a CONSTANT_MethodHandle_info structure.
	BootstrapMethodRef uint16

	// Each entry in the bootstrap_arguments array must be a valid index into the constant_pool table.
	//  The constant_pool entry at that index must be loadable.
	BoostrapArguments []uint16
}

type CatchTarget added in v1.5.0

type CatchTarget struct {
	ExceptionTableIndex uint16
}

func NewCatchTarget added in v1.5.0

func NewCatchTarget(stream *commons.Stream) (*CatchTarget, error)

type ClassAccessFlag added in v1.5.0

type ClassAccessFlag uint16
const (
	ClassAccPublic     ClassAccessFlag = 0x0001 // Declared public; may be accessed from outside its package.
	ClassAccPrivate    ClassAccessFlag = 0x0002 // Marked private in source.
	ClassAccProtected  ClassAccessFlag = 0x0004 // Marked protected in source.
	ClassAccStatic     ClassAccessFlag = 0x0008 // Marked or implicitly static in source.
	ClassAccFinal      ClassAccessFlag = 0x0010 // Declared final; no subclasses allowed.
	ClassAccSuper      ClassAccessFlag = 0x0020 // Treat superclass methods specially when invoked by the invokespecial instruction.
	ClassAccInterface  ClassAccessFlag = 0x0200 // Is an interface, not a class.
	ClassAccAbstract   ClassAccessFlag = 0x0400 // Declared abstract; must not be instantiated.
	ClassAccSynthetic  ClassAccessFlag = 0x1000 // Declared synthetic; not present in the source code.
	ClassAccAnnotation ClassAccessFlag = 0x2000 // Declared as an annotation type.
	ClassAccEnum       ClassAccessFlag = 0x4000 // Declared as an enum type.
	ClassAccModule     ClassAccessFlag = 0x8000 // Is a module, not a class or interface.
)

func (ClassAccessFlag) HasAccessFlag added in v1.5.0

func (caf ClassAccessFlag) HasAccessFlag(flag ClassAccessFlag) bool

type ClassFile

type ClassFile struct {
	MagicNumber         []byte
	MinorVersion        uint16
	MajorVersion        uint16
	ConstantPool        []Constant
	AccessFlag          ClassAccessFlag
	ThisClassIndex      uint16
	SuperClassIndex     uint16
	InterfaceIndexArray []uint16
	Fields              []*Field
	Methods             []*Method
	Attributes          []*Attribute
}

func ParseClass

func ParseClass(data []byte) (*ClassFile, error)

type Constant

type Constant interface {
	ToBytes() []byte
}

type ConstantClass

type ConstantClass struct {
	NameIndex uint16
}

func (*ConstantClass) ToBytes

func (c *ConstantClass) ToBytes() []byte

type ConstantDouble

type ConstantDouble struct {
	Double float64
}

func (*ConstantDouble) ToBytes

func (c *ConstantDouble) ToBytes() []byte

type ConstantDynamic

type ConstantDynamic struct {
	BootstrapMethodIndex uint16 // a reference to the BootstrapMethod in ClassFile.Attributes
	NameAndTypeIndex     uint16
}

func (*ConstantDynamic) ToBytes

func (c *ConstantDynamic) ToBytes() []byte

type ConstantFieldRef

type ConstantFieldRef struct {
	ClassIndex       uint16
	NameAndTypeIndex uint16
}

func (*ConstantFieldRef) ToBytes

func (c *ConstantFieldRef) ToBytes() []byte

type ConstantFloat

type ConstantFloat struct {
	Float float32
}

func (*ConstantFloat) ToBytes

func (c *ConstantFloat) ToBytes() []byte

type ConstantInteger

type ConstantInteger struct {
	Integer int32
}

func (*ConstantInteger) ToBytes

func (c *ConstantInteger) ToBytes() []byte

type ConstantInterfaceMethodRef

type ConstantInterfaceMethodRef struct {
	ClassIndex       uint16
	NameAndTypeIndex uint16
}

func (*ConstantInterfaceMethodRef) ToBytes

func (c *ConstantInterfaceMethodRef) ToBytes() []byte

type ConstantInvokeDynamic

type ConstantInvokeDynamic struct {
	BootstrapMethodIndex uint16 // a reference to the BootstrapMethod in ClassFile.Attributes
	NameAndTypeIndex     uint16
}

func (*ConstantInvokeDynamic) ToBytes

func (c *ConstantInvokeDynamic) ToBytes() []byte

type ConstantLong

type ConstantLong struct {
	Long int64
}

func (*ConstantLong) ToBytes

func (c *ConstantLong) ToBytes() []byte

type ConstantMethodHandle

type ConstantMethodHandle struct {
	ReferenceKind  byte
	ReferenceIndex uint16
}

func (*ConstantMethodHandle) ToBytes

func (c *ConstantMethodHandle) ToBytes() []byte

type ConstantMethodRef

type ConstantMethodRef struct {
	ClassIndex       uint16
	NameAndTypeIndex uint16
}

func (*ConstantMethodRef) ToBytes

func (c *ConstantMethodRef) ToBytes() []byte

type ConstantMethodType

type ConstantMethodType struct {
	DescriptorIndex uint16
}

func (*ConstantMethodType) ToBytes

func (c *ConstantMethodType) ToBytes() []byte

type ConstantModule

type ConstantModule struct {
	NameIndex uint16
}

func (*ConstantModule) ToBytes

func (c *ConstantModule) ToBytes() []byte

type ConstantNameAndType

type ConstantNameAndType struct {
	NameIndex       uint16
	DescriptorIndex uint16
}

func (*ConstantNameAndType) ToBytes

func (c *ConstantNameAndType) ToBytes() []byte

type ConstantPackage

type ConstantPackage struct {
	NameIndex uint16
}

func (*ConstantPackage) ToBytes

func (c *ConstantPackage) ToBytes() []byte

type ConstantString

type ConstantString struct {
	StringIndex uint16
}

func (*ConstantString) ToBytes

func (c *ConstantString) ToBytes() []byte

type ConstantUTF8

type ConstantUTF8 struct {
	Data string
}

func (*ConstantUTF8) ToBytes

func (c *ConstantUTF8) ToBytes() []byte

type ElementValue added in v1.5.0

type ElementValue struct {
	Tag byte

	ConstValueIndex uint16
	EnumConstValue  *EnumConstValue
	ClassInfoIndex  uint16
	AnnotationValue *Annotation
	ArrayValue      []*ElementValue
}

ElementValue https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.16.1

func NewElementValue added in v1.5.0

func NewElementValue(stream *commons.Stream) (*ElementValue, error)

type ElementValuePair added in v1.5.0

type ElementValuePair struct {
	ElementNameIndex uint16
	Value            *ElementValue
}

type EmptyTarget added in v1.5.0

type EmptyTarget struct {
}

type EnumConstValue added in v1.5.0

type EnumConstValue struct {
	TypeNameIndex  uint16
	ConstNameIndex uint16
}

type Exception

type Exception struct {
	// The values of the two items StartPC and EndPC indicate the ranges
	//    in the code array at which the exception handler is active.
	StartPC uint16
	EndPC   uint16

	// The value of the HandlerPC item indicates the start of the exception handler.
	HandlerPC uint16

	// If the value of the CatchType item is nonzero, it must be a valid index into the constant pool table.
	// If the value of the CatchType item is zero, this exception handler is called for all exceptions.
	CatchType uint16
}

type Field

type Field struct {
	AccessFlag      AttrAccessFlag
	NameIndex       uint16
	DescriptorIndex uint16
	Attributes      []Attribute
}

type FormalParameterTarget added in v1.5.0

type FormalParameterTarget struct {
	FormalParameterIndex uint8
}

func NewFormalParameterTarget added in v1.5.0

func NewFormalParameterTarget(stream *commons.Stream) (*FormalParameterTarget, error)

type InnerClass

type InnerClass struct {
	// The value of the InnerClassInfo item must be a valid index into the constant_pool table.
	InnerClassInfo uint16

	// The value of the InnerClassIndex item must be a valid index into the constant_pool table
	OuterClassInfo uint16

	// The value of the InnerClassIndex item must be a valid index into the constant_pool table
	InnerClassIndex uint16

	// The value of the InnerClassAccessFlags item is a mask of flags used to denote access permissions to
	//  and properties of class or interface C as declared in the source code from which this class file was compiled.
	InnerClassAccessFlags ClassAccessFlag
}

func (*InnerClass) HasFlag

func (ic *InnerClass) HasFlag(flag ClassAccessFlag) bool

type LineNumberTable

type LineNumberTable struct {
	// The value of the StartPC item must be a valid index into the code array of this AttrCode attribute.
	StartPC uint16

	// The value of the LineNumber item gives the corresponding line number in the original source file.
	LineNumber uint16
}

type LocalVarTarget added in v1.5.0

type LocalVarTarget struct {
	Table []*LocalVarTargetTable
}

func NewLocalVarTarget added in v1.5.0

func NewLocalVarTarget(stream *commons.Stream) (*LocalVarTarget, error)

type LocalVarTargetTable added in v1.5.0

type LocalVarTargetTable struct {
	StartPC uint16
	Length  uint16
	Index   uint16
}

type LocalVariableTable

type LocalVariableTable struct {
	StartPC         uint16
	Length          uint16
	NameIndex       uint16
	DescriptorIndex uint16
	Index           uint16
}

type LocalVariableTypeTable

type LocalVariableTypeTable struct {
	StartPC        uint16
	Length         uint16
	NameIndex      uint16
	SignatureIndex uint16
	Index          uint16
}

type Method

type Method struct {
}

type MethodParameter added in v1.5.0

type MethodParameter struct {
	NameIndex   uint16
	AccessFlags ParameterAccessFlag
}

type ModuleExports added in v1.5.0

type ModuleExports struct {
	ExportsIndex   uint16
	ExportsFlags   uint16
	ExportsToIndex []uint16
}

type ModuleOpens added in v1.5.0

type ModuleOpens struct {
	OpensIndex   uint16
	OpensFlags   uint16
	OpensToIndex []uint16
}

type ModuleProvides added in v1.5.0

type ModuleProvides struct {
	ProvidesIndex     uint16
	ProvidesWithIndex []uint16
}

type ModuleRequires added in v1.5.0

type ModuleRequires struct {
	RequiresIndex        uint16
	RequiresFlags        uint16
	RequiresVersionIndex uint16
}

type OffsetTarget added in v1.5.0

type OffsetTarget struct {
	Offset uint16
}

func NewOffsetTarget added in v1.5.0

func NewOffsetTarget(stream *commons.Stream) (*OffsetTarget, error)

type ParameterAccessFlag added in v1.5.0

type ParameterAccessFlag uint16
const (
	ParameterAccFinal     ParameterAccessFlag = 0x0010
	ParameterAccSynthetic ParameterAccessFlag = 0x1000
	ParameterAccMandated  ParameterAccessFlag = 0x8000
)

func (ParameterAccessFlag) HasAccessFlag added in v1.5.0

func (caf ParameterAccessFlag) HasAccessFlag(flag ParameterAccessFlag) bool

type ParameterAnnotation added in v1.5.0

type ParameterAnnotation struct {
	Annotations []*Annotation
}

type RecordComponentInfo added in v1.5.0

type RecordComponentInfo struct {
	// The value of the name_index item must be a valid index into the constant_pool table.
	//  The constant_pool entry at that index must be a CONSTANT_Utf8_info structure (§4.4.7) representing a valid unqualified name denoting the record component (§4.2.2).
	NameIndex uint16

	// The value of the descriptor_index item must be a valid index into the constant_pool table.
	//  The constant_pool entry at that index must be a CONSTANT_Utf8_info structure (§4.4.7) representing a field descriptor which encodes the type of the record component (§4.3.2).
	DescriptorIndex uint16

	// Each value of the attributes table must be an attribute_info structure (§4.7).
	Attributes []Attribute
}

type SuperTypeTarget added in v1.5.0

type SuperTypeTarget struct {
	SuperTypeIndex uint16
}

func NewSuperTypeTarget added in v1.5.0

func NewSuperTypeTarget(stream *commons.Stream) (*SuperTypeTarget, error)

type ThrowsTarget added in v1.5.0

type ThrowsTarget struct {
	ThrowsTypeIndex uint16
}

func NewThrowsTarget added in v1.5.0

func NewThrowsTarget(stream *commons.Stream) (*ThrowsTarget, error)

type TypeAnnotation added in v1.5.0

type TypeAnnotation struct {
	TargetType               uint8
	TypeParameterTarget      *TypeParameterTarget
	SuperTypeTarget          *SuperTypeTarget
	TypeParameterBoundTarget *TypeParameterBoundTarget
	EmptyTarget              *EmptyTarget
	FormalParameterTarget    *FormalParameterTarget
	ThrowsTarget             *ThrowsTarget
	LocalVarTarget           *LocalVarTarget
	CatchTarget              *CatchTarget
	OffsetTarget             *OffsetTarget
	TypeArgumentTarget       *TypeArgumentTarget

	TargetPath *TypePath

	// same as Annotation
	TypeIndex         uint16
	ElementValuePairs []*ElementValuePair
}

TypeAnnotation https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.20

func NewTypeAnnotation added in v1.5.0

func NewTypeAnnotation(stream *commons.Stream) (*TypeAnnotation, error)

type TypeArgumentTarget added in v1.5.0

type TypeArgumentTarget struct {
	Offset            uint16
	TypeArgumentIndex uint8
}

func NewTypeArgumentTarget added in v1.5.0

func NewTypeArgumentTarget(stream *commons.Stream) (*TypeArgumentTarget, error)

type TypeParameterBoundTarget added in v1.5.0

type TypeParameterBoundTarget struct {
	TypeParameterIndex uint8
	BoundIndex         uint8
}

func NewTypeParameterBoundTarget added in v1.5.0

func NewTypeParameterBoundTarget(stream *commons.Stream) (*TypeParameterBoundTarget, error)

type TypeParameterTarget added in v1.5.0

type TypeParameterTarget struct {
	TypeParameterIndex uint8
}

TypeParameterTarget https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.7.20.1

func NewTypeParameterTarget added in v1.5.0

func NewTypeParameterTarget(stream *commons.Stream) (*TypeParameterTarget, error)

type TypePath added in v1.5.0

type TypePath struct {
	Path []*TypePathNode
}

func NewTypePath added in v1.5.0

func NewTypePath(stream *commons.Stream) (*TypePath, error)

type TypePathNode added in v1.5.0

type TypePathNode struct {
	TypePathKind      uint8
	TypeArgumentIndex uint8
}

Jump to

Keyboard shortcuts

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