Interface Descriptor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.function.Function<java.lang.String,​Type> NO_SUBSTITUTION  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.lang.String descriptor()
      Returns a bytecode descriptor of this element.
      java.lang.String descriptor​(java.util.function.Function<java.lang.String,​Type> typeVariableSubstitution)
      Returns a bytecode descriptor of this element.
      static void forType​(Type type, java.util.function.Function<java.lang.String,​Type> typeVariableSubstitution, java.lang.StringBuilder result)
      Appends a bytecode descriptor of a single type to given StringBuilder.
    • Field Detail

      • NO_SUBSTITUTION

        static final java.util.function.Function<java.lang.String,​Type> NO_SUBSTITUTION
    • Method Detail

      • descriptor

        default java.lang.String descriptor()
        Returns a bytecode descriptor of this element.

        Note that the return value does not come directly from bytecode. Jandex does not store the descriptor strings. Instead, the return value is reconstructed from the Jandex object model.

        Returns:
        a bytecode descriptor of this declaration, never null
      • descriptor

        java.lang.String descriptor​(java.util.function.Function<java.lang.String,​Type> typeVariableSubstitution)
        Returns a bytecode descriptor of this element.

        Descriptors of type variables are substituted for descriptors of types provided by the substitution function typeVariableSubstitution. If the substitution function returns null for some type variable identifier, or if it returns the type variable itself, no substitution happens and the type variable descriptor is used unmodified.

        Note that the return value does not come directly from bytecode. Jandex does not store the descriptor strings. Instead, the return value is reconstructed from the Jandex object model.

        Parameters:
        typeVariableSubstitution - a substitution function from type variable identifiers to types
        Returns:
        a bytecode descriptor of this declaration, never null
      • forType

        static void forType​(Type type,
                            java.util.function.Function<java.lang.String,​Type> typeVariableSubstitution,
                            java.lang.StringBuilder result)
        Appends a bytecode descriptor of a single type to given StringBuilder.

        Descriptors of type variables are substituted for descriptors of types provided by the substitution function typeVariableSubstitution. If the substitution function returns null for some type variable identifier, or if it returns the type variable itself, no substitution happens and the type variable descriptor is used unmodified.

        Parameters:
        type - a type whose bytecode descriptor is appended to result
        typeVariableSubstitution - a substitution function from type variable identifiers to types
        result - the StringBuilder to which the bytecode descriptor is appended