Class TypePath
🏭 Constructors
constructor
new TypePath(b: Uint8Array, offset: number): TypePath
Creates a new type path.
Parameters
- b:
Uint8Array
the byte array containing the type path in Java class file format. - offset:
number
the offset of the first byte of the type path in 'b'.
Return Type
TypePath
Defined in: packages/asm/libs/TypePath.ts:83
🏷️ Properties
buf
buf: Uint8Array
The byte array where the path is stored, in Java class file format.
Defined in: packages/asm/libs/TypePath.ts:67
offset
offset: number
The offset of the first byte of the type path in 'b'.
Defined in: packages/asm/libs/TypePath.ts:72
ARRAY_ELEMENT
ARRAY_ELEMENT: number = 0
A type path step that steps into the element type of an array type. See #getStep getStep.
Defined in: packages/asm/libs/TypePath.ts:44
INNER_TYPE
INNER_TYPE: number = 1
A type path step that steps into the nested type of a class type. See #getStep getStep.
Defined in: packages/asm/libs/TypePath.ts:50
TYPE_ARGUMENT
TYPE_ARGUMENT: number = 3
A type path step that steps into a type argument of a generic type. See #getStep getStep.
Defined in: packages/asm/libs/TypePath.ts:62
WILDCARD_BOUND
WILDCARD_BOUND: number = 2
A type path step that steps into the bound of a wildcard type. See #getStep getStep.
Defined in: packages/asm/libs/TypePath.ts:56
🔑 Accessors
length
Defined in: packages/asm/libs/TypePath.ts:94
🔧 Methods
getStep
getStep(index: number): number
Returns the value of the given step of this path.
Parameters
- index:
number
an index between 0 and #getLength(), exclusive.
Return Type
number
Defined in: packages/asm/libs/TypePath.ts:107
getStepArgument
getStepArgument(index: number): number
Returns the index of the type argument that the given step is stepping into. This method should only be used for steps whose value is #TYPE_ARGUMENT TYPE_ARGUMENT.
Parameters
- index:
number
an index between 0 and #getLength(), exclusive.
Return Type
number
Defined in: packages/asm/libs/TypePath.ts:121
toString
toString(): string
Returns a string representation of this type path. #ARRAY_ELEMENT ARRAY_ELEMENT steps are represented with '[', #INNER_TYPE INNER_TYPE steps with '.', #WILDCARD_BOUND WILDCARD_BOUND steps with '*' and #TYPE_ARGUMENT TYPE_ARGUMENT steps with their type argument index in decimal form followed by ';'.
Return Type
string
Defined in: packages/asm/libs/TypePath.ts:172
fromString
fromString(typePath: string): null | TypePath
Converts a type path in string form, in the format used by #toString(), into a TypePath object.
Parameters
- typePath:
string
a type path in string form, in the format used by #toString(). May be null or empty.
Return Type
null | TypePath
Defined in: packages/asm/libs/TypePath.ts:134