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

public interface TypeVariableSource extends ModifierReviewable.OfAbstraction
A type variable source represents a code element that can declare type variables.
  • Field Details

  • 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

      @MaybeNull 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()
      Returns true 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

      TypeDescription.Generic findExpectedVariable(String symbol)
      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

      <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.