Top Description Fields Methods
org.jboss.jandex

public Interface Descriptor

Known Direct Implementers
org.jboss.jandex.FieldInfo, org.jboss.jandex.MethodInfo, org.jboss.jandex.RecordComponentInfo, org.jboss.jandex.Type, org.jboss.jandex.ClassInfo
Imports
java.util.function.Function

Implementations of this interface have a bytecode descriptor, as defined in JVMS 17, chapter 4.3.

Field Summary

Modifier and TypeField and Description
public static final Function<String, Type>

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

a bytecode descriptor of this declaration, never null
descriptor
()

Returns a bytecode descriptor of this element.

public String

Returns:

a bytecode descriptor of this declaration, never null
descriptor
(Function<String, Type>
a substitution function from type variable identifiers to types
typeVariableSubstitution
)

Returns a bytecode descriptor of this element.

public static void
forType(Type
a type whose bytecode descriptor is appended to result
type
,
Function<String, Type>
a substitution function from type variable identifiers to types
typeVariableSubstitution
,
StringBuilder
the StringBuilder to which the bytecode descriptor is appended
result
)

Appends a bytecode descriptor of a single type to given StringBuilder.

Field Detail

NO_SUBSTITUTIONback to summary
public static final Function<String, Type> NO_SUBSTITUTION

Method Detail

descriptorback to summary
public default 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:String

a bytecode descriptor of this declaration, never null

descriptorback to summary
public String descriptor(Function<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:Function<String, Type>

a substitution function from type variable identifiers to types

Returns:String

a bytecode descriptor of this declaration, never null

forTypeback to summary
public static void forType(Type type, Function<String, Type> typeVariableSubstitution, 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:Type

a type whose bytecode descriptor is appended to result

typeVariableSubstitution:Function<String, Type>

a substitution function from type variable identifiers to types

result:StringBuilder

the StringBuilder to which the bytecode descriptor is appended