saker.build Documentation TaskDoc JavaDoc Packages
public final class TypePath
The path to a type argument, wildcard bound, array element type, or static inner type within an enclosing type.
Fields
public static final int
A type path step that steps into the element type of an array type.
public static final int
A type path step that steps into the nested type of a class type.
public static final int
A type path step that steps into a type argument of a generic type.
public static final int
A type path step that steps into the bound of a wildcard type.
Methods
public static TypePath
fromString(String typePath)
Converts a type path in string form, in the format used by toString(), into a TypePath object.
public int
Returns the length of this path, i.e.
public int
getStep(int index)
Returns the value of the given step of this path.
public int
getStepArgument(int index)
Returns the index of the type argument that the given step is stepping into.
public String
Returns a string representation of this type path.
public static final int ARRAY_ELEMENT = 0
A type path step that steps into the element type of an array type. See getStep(int).
public static final int INNER_TYPE = 1
A type path step that steps into the nested type of a class type. See getStep(int).
public static final int TYPE_ARGUMENT = 3
A type path step that steps into a type argument of a generic type. See getStep(int).
public static final int WILDCARD_BOUND = 2
A type path step that steps into the bound of a wildcard type. See getStep(int).
public static TypePath fromString(String typePath)
Converts a type path in string form, in the format used by toString(), into a TypePath object.
typePatha type path in string form, in the format used by toString(). May be null or empty.
the corresponding TypePath object, or null if the path is empty.
public int getLength()
Returns the length of this path, i.e. its number of steps.
the length of this path.
public int getStep(int index)
Returns the value of the given step of this path.
indexan index between 0 and getLength(), exclusive.
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 is TYPE_ARGUMENT.
indexan index between 0 and getLength(), exclusive.
the index of the type argument that the given step is stepping into.
public String toString()
Returns a string representation of this type path. ARRAY_ELEMENT steps are represented with '[', INNER_TYPE steps with '.', WILDCARD_BOUND steps with '*' and TYPE_ARGUMENT steps with their type argument index in decimal form followed by ';'.
a string representation of the object.