Interface Descriptor
- All Known Implementing Classes:
ArrayType
,ClassInfo
,ClassType
,FieldInfo
,MethodInfo
,ParameterizedType
,PrimitiveType
,RecordComponentInfo
,Type
,TypeVariable
,TypeVariableReference
,UnresolvedTypeVariable
,VoidType
,WildcardType
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault String
Returns a bytecode descriptor of this element.descriptor
(Function<String, Type> typeVariableSubstitution) Returns a bytecode descriptor of this element.static void
Appends a bytecode descriptor of a single type to givenStringBuilder
.
-
Field Details
-
NO_SUBSTITUTION
-
-
Method Details
-
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
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 returnsnull
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, Function<String, Type> typeVariableSubstitution, StringBuilder result) Appends a bytecode descriptor of a single type to givenStringBuilder
.Descriptors of type variables are substituted for descriptors of types provided by the substitution function
typeVariableSubstitution
. If the substitution function returnsnull
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 toresult
typeVariableSubstitution
- a substitution function from type variable identifiers to typesresult
- theStringBuilder
to which the bytecode descriptor is appended
-