类 TypePath
java.lang.Object
cn.taketoday.bytecode.TypePath
The path to a type argument, wildcard bound, array element type, or static inner type within an
enclosing type.
- 作者:
- Eric Bruneton
-
字段概要
字段修饰符和类型字段说明static final intA type path step that steps into the element type of an array type.static final intA type path step that steps into the nested type of a class type.static final intA type path step that steps into a type argument of a generic type.private final byte[]The byte array where the 'type_path' structure - as defined in the Java Virtual Machine Specification (JVMS) - corresponding to this TypePath is stored.private final intThe offset of the first byte of the type_path JVMS structure intypePathContainer.static final intA type path step that steps into the bound of a wildcard type. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static TypePathfromString(String typePath) Converts a type path in string form, in the format used bytoString(), into a TypePath object.intReturns the length of this path, i.e. its number of steps.intgetStep(int index) Returns the value of the given step of this path.intgetStepArgument(int index) Returns the index of the type argument that the given step is stepping into.(专用程序包) static voidput(TypePath typePath, ByteVector output) Puts the type_path JVMS structure corresponding to the given TypePath into the given ByteVector.toString()Returns a string representation of this type path.
-
字段详细资料
-
ARRAY_ELEMENT
public static final int ARRAY_ELEMENTA type path step that steps into the element type of an array type. SeegetStep(int).- 另请参阅:
-
INNER_TYPE
public static final int INNER_TYPEA type path step that steps into the nested type of a class type. SeegetStep(int).- 另请参阅:
-
WILDCARD_BOUND
public static final int WILDCARD_BOUNDA type path step that steps into the bound of a wildcard type. SeegetStep(int).- 另请参阅:
-
TYPE_ARGUMENT
public static final int TYPE_ARGUMENTA type path step that steps into a type argument of a generic type. SeegetStep(int).- 另请参阅:
-
typePathContainer
private final byte[] typePathContainerThe byte array where the 'type_path' structure - as defined in the Java Virtual Machine Specification (JVMS) - corresponding to this TypePath is stored. The first byte of the structure in this array is given bytypePathOffset.- 另请参阅:
-
typePathOffset
private final int typePathOffsetThe offset of the first byte of the type_path JVMS structure intypePathContainer.
-
-
构造器详细资料
-
TypePath
TypePath(byte[] typePathContainer, int typePathOffset) Constructs a new TypePath.- 参数:
typePathContainer- a byte array containing a type_path JVMS structure.typePathOffset- the offset of the first byte of the type_path structure in typePathContainer.
-
-
方法详细资料
-
getLength
public int getLength()Returns the length of this path, i.e. its number of steps.- 返回:
- the length of this path.
-
getStep
public int getStep(int index) Returns the value of the given step of this path.- 参数:
index- an index between 0 andgetLength(), exclusive.- 返回:
- one of
ARRAY_ELEMENT,INNER_TYPE,WILDCARD_BOUND, orTYPE_ARGUMENT.
-
getStepArgument
public int getStepArgument(int index) Returns the index of the type argument that the given step is stepping into. This method should only be used for steps whose value isTYPE_ARGUMENT.- 参数:
index- an index between 0 andgetLength(), exclusive.- 返回:
- the index of the type argument that the given step is stepping into.
-
fromString
Converts a type path in string form, in the format used bytoString(), into a TypePath object.- 参数:
typePath- a type path in string form, in the format used bytoString(). May be null or empty.- 返回:
- the corresponding TypePath object, or null if the path is empty.
-
toString
Returns a string representation of this type path.ARRAY_ELEMENTsteps are represented with '[',INNER_TYPEsteps with '.',WILDCARD_BOUNDsteps with '*' andTYPE_ARGUMENTsteps with their type argument index in decimal form followed by ';'. -
put
Puts the type_path JVMS structure corresponding to the given TypePath into the given ByteVector.- 参数:
typePath- a TypePath instance, or null for empty paths.output- where the type path must be put.
-