TypePath (Grails 6.0.0)

Package: org.grails.asm

## [Java] Class TypePath

- org.grails.asm.TypePath

-     class TypePath
      extends java.lang.Object

  The path to a type argument, wildcard bound, array element type, or static inner type within an enclosing type.

  Authors:
    Eric Bruneton

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static int` | `ARRAY_ELEMENT` | A type path step that steps into the element type of an array type.
    `static int` | `INNER_TYPE` | A type path step that steps into the nested type of a class type.
    `static int` | `TYPE_ARGUMENT` | A type path step that steps into a type argument of a generic type.
    `static int` | `WILDCARD_BOUND` | A type path step that steps into the bound of a wildcard type.
    `byte[]` | `b` | The byte array where the path is stored, in Java class file format.
    `int` | `offset` | The offset of the first byte of the type path in 'b'.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `TypePath (byte[] b, int offset)` Creates a new type path.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static TypePath` | `fromString(java.lang.String typePath)` Converts a type path in string form, in the format used by toString(), into a TypePath object.
    `` | `public int` | `getLength()` Returns the length of this path.
    `` | `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 java.lang.String` | `toString()` Returns a string representation of this type path.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### public static final int ARRAY_ELEMENT

      A type path step that steps into the element type of an array type. See getStep.

    - #### public static final int INNER_TYPE

      A type path step that steps into the nested type of a class type. See getStep.

    - #### public static final int TYPE_ARGUMENT

      A type path step that steps into a type argument of a generic type. See getStep.

    - #### public static final int WILDCARD_BOUND

      A type path step that steps into the bound of a wildcard type. See getStep.

    - #### byte[] b

      The byte array where the path is stored, in Java class file format.

    - #### int offset

      The offset of the first byte of the type path in 'b'.

  - ### Constructor Detail

    - #### TypePath(byte[] b, int offset)

      Creates a new type path.

      Parameters:
        `b` - the byte array containing the type path in Java class file format.
        `offset` - the offset of the first byte of the type path in 'b'.

  - ### Method Detail

    - #### public static TypePath fromString(java.lang.String typePath)

      Converts a type path in string form, in the format used by toString(), into a TypePath object.

      Parameters:
        `typePath` - a type path in string form, in the format used by toString(). May be null or empty.
      Returns:
        the corresponding TypePath object, or null if the path is empty.

    - #### public int getLength()

      Returns the length of this path.

      Returns:
        the length of this path.

    - #### public int getStep(int index)

      Returns the value of the given step of this path.

      Parameters:
        `index` - an index between 0 and getLength(), exclusive.
      Returns:
        ARRAY_ELEMENT, INNER_TYPE, WILDCARD_BOUND, or TYPE_ARGUMENT.

    - #### 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.

      Parameters:
        `index` - an index between 0 and getLength(), exclusive.
      Returns:
        the index of the type argument that the given step is stepping into.

    - #### @java.lang.Override public java.lang.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 ';'.