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
,MethodDescription.AbstractBase
,MethodDescription.ForLoadedConstructor
,MethodDescription.ForLoadedMethod
,MethodDescription.InDefinedShape.AbstractBase
,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.ForLoadedType.ClassDescriptionTypeList.InternalNameLazyType
,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
public interface TypeVariableSource extends ModifierReviewable.OfAbstraction
A type variable source represents a code element that can declare type variables.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TypeVariableSource.AbstractBase
An abstract base implementation of a type variable source.static interface
TypeVariableSource.Visitor<T>
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
Fields Modifier and Type Field Description static TypeVariableSource
UNDEFINED
Indicates that a type variable source is undefined.-
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
accept(TypeVariableSource.Visitor<T> visitor)
Applies a visitor on this type variable source.TypeDescription.Generic
findVariable(java.lang.String symbol)
Finds a particular variable with the given name in the closes type variable source that is visible from this instance.TypeVariableSource
getEnclosingSource()
Returns the enclosing source of type variables that are valid in the scope of this type variable source.TypeList.Generic
getTypeVariables()
Returns the type variables that are declared by this element.boolean
isGenerified()
Checks if this type variable source has a generic declaration.boolean
isInferrable()
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 Detail
-
UNDEFINED
static final TypeVariableSource UNDEFINED
Indicates that a type variable source is undefined.
-
-
Method Detail
-
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
TypeVariableSource 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
TypeDescription.Generic findVariable(java.lang.String symbol)
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.
-
accept
<T> T accept(TypeVariableSource.Visitor<T> visitor)
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.
-
-