Package net.bytebuddy.description
Interface TypeVariableSource
- All Superinterfaces:
ModifierReviewable
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
- All Known Subinterfaces:
InstrumentedType
,InstrumentedType.WithFlexibleName
,MethodDescription
,MethodDescription.InDefinedShape
,MethodDescription.InGenericShape
,TypeDescription
- All Known Implementing Classes:
Implementation.Context.Default.AbstractPropertyAccessorMethod
,Implementation.Context.Default.AccessorMethod
,Implementation.Context.Default.FieldGetter
,Implementation.Context.Default.FieldSetter
,InstrumentedType.Default
,InstrumentedType.Frozen
,JavaType.LatentTypeWithSimpleName
,MethodDescription.AbstractBase
,MethodDescription.ForLoadedConstructor
,MethodDescription.ForLoadedMethod
,MethodDescription.InDefinedShape.AbstractBase
,MethodDescription.InDefinedShape.AbstractBase.ForLoadedExecutable
,MethodDescription.Latent
,MethodDescription.Latent.TypeInitializer
,MethodDescription.TypeSubstituting
,MethodRebaseResolver.Resolution.ForRebasedConstructor.RebasedConstructor
,MethodRebaseResolver.Resolution.ForRebasedMethod.RebasedMethod
,Transformer.ForMethod.TransformedMethod
,TypeDescription.AbstractBase
,TypeDescription.AbstractBase.OfSimpleType
,TypeDescription.AbstractBase.OfSimpleType.WithDelegation
,TypeDescription.ArrayProjection
,TypeDescription.ForLoadedType
,TypeDescription.ForPackageDescription
,TypeDescription.Latent
,TypeDescription.SuperTypeLoading
,TypePool.Default.LazyTypeDescription
,TypePool.Default.LazyTypeDescription.LazyMethodDescription
,TypePool.Default.WithLazyResolution.LazyTypeDescription
,TypePool.LazyFacade.LazyTypeDescription
,TypeVariableSource.AbstractBase
,TypeWriter.MethodPool.Record.AccessBridgeWrapper.AccessorBridge
,TypeWriter.MethodPool.Record.AccessBridgeWrapper.BridgeTarget
,TypeWriter.MethodPool.Record.ForDefinedMethod.OfVisibilityBridge.VisibilityBridge
A type variable source represents a code element that can declare type variables.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
An abstract base implementation of a type variable source.static interface
A visitor that can be applied to a type variable source.Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeVariableSource
Indicates that a type variable source is undefined.Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(TypeVariableSource.Visitor<T> visitor) Applies a visitor on this type variable source.findExpectedVariable
(String symbol) Finds a particular variable with the given name in the closes type variable source that is visible from this instance.findVariable
(String symbol) Finds a particular variable with the given name in the closes type variable source that is visible from this instance.Returns the enclosing source of type variables that are valid in the scope of this type variable source.Returns the type variables that are declared by this element.boolean
Checks if this type variable source has a generic declaration.boolean
Returnstrue
if type variables declared by this type variable source allow dynamic type inference.Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getModifiers, getSyntheticState, isFinal, isSynthetic
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstract
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
Field Details
-
UNDEFINED
Indicates that a type variable source is undefined.
-
-
Method Details
-
getTypeVariables
TypeList.Generic getTypeVariables()Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getEnclosingSource
Returns the enclosing source of type variables that are valid in the scope of this type variable source.- Returns:
- The enclosing source or
null
if no such source exists.
-
isInferrable
boolean isInferrable()Returnstrue
if type variables declared by this type variable source allow dynamic type inference.- Returns:
true
if type variables declared by this type variable source allow dynamic type inference.
-
findVariable
Finds a particular variable with the given name in the closes type variable source that is visible from this instance.- Parameters:
symbol
- The symbolic name of the type variable.- Returns:
- The type variable or
null
if it was not found.
-
findExpectedVariable
Finds a particular variable with the given name in the closes type variable source that is visible from this instance. If the variable is not found, an exception is thrown.- Parameters:
symbol
- The symbolic name of the type variable.- Returns:
- The type variable.
-
accept
Applies a visitor on this type variable source.- Type Parameters:
T
- The visitor's return type.- Parameters:
visitor
- The visitor to apply.- Returns:
- The visitor's return value.
-
isGenerified
boolean isGenerified()Checks if this type variable source has a generic declaration. This means:- A type declares type variables or is an inner class of a type with a generic declaration.
- A method declares at least one type variable.
- Returns:
true
if this type code element has a generic declaration.
-