Package io.ebean.enhance.asm
Class TypePath
java.lang.Object
io.ebean.enhance.asm.TypePath
The path to a type argument, wildcard bound, array element type, or static inner type within an
enclosing type.
- Author:
- Eric Bruneton
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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.static final intA type path step that steps into the bound of a wildcard type. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.toString()Returns a string representation of this type path.
-
Field Details
-
ARRAY_ELEMENT
A type path step that steps into the element type of an array type. SeegetStep(int).- See Also:
-
INNER_TYPE
A type path step that steps into the nested type of a class type. SeegetStep(int).- See Also:
-
WILDCARD_BOUND
A type path step that steps into the bound of a wildcard type. SeegetStep(int).- See Also:
-
TYPE_ARGUMENT
A type path step that steps into a type argument of a generic type. SeegetStep(int).- See Also:
-
-
Method Details
-
getLength
Returns the length of this path, i.e. its number of steps.- Returns:
- the length of this path.
-
getStep
Returns the value of the given step of this path.- Parameters:
index- an index between 0 andgetLength(), exclusive.- Returns:
- one of
ARRAY_ELEMENT,INNER_TYPE,WILDCARD_BOUND, orTYPE_ARGUMENT.
-
getStepArgument
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.- Parameters:
index- an index between 0 andgetLength(), exclusive.- Returns:
- 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.- Parameters:
typePath- a type path in string form, in the format used bytoString(). May be null or empty.- Returns:
- 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 ';'.
-