Class ParameterDescription.Latent

All Implemented Interfaces:
AnnotationSource, ByteCodeElement.TypeDependant<ParameterDescription.InDefinedShape,ParameterDescription.Token>, ParameterDescription, ParameterDescription.InDefinedShape, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, NamedElement, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
Enclosing interface:
ParameterDescription

public static class ParameterDescription.Latent extends ParameterDescription.InDefinedShape.AbstractBase
A latent description of a parameter that is not attached to a method or constructor.
  • Field Details

    • declaringMethod

      private final MethodDescription.InDefinedShape declaringMethod
      The method that is declaring the parameter.
    • parameterType

      private final TypeDescription.Generic parameterType
      The type of the parameter.
    • declaredAnnotations

      private final List<? extends AnnotationDescription> declaredAnnotations
      The annotations of the parameter.
    • name

      @MaybeNull private final String name
      The name of the parameter or null if no name is explicitly defined.
    • modifiers

      @MaybeNull private final Integer modifiers
      The modifiers of the parameter or null if no modifiers are explicitly defined.
    • index

      private final int index
      The index of the parameter.
    • offset

      private final int offset
      The parameter's offset in the local method variables array.
  • Constructor Details

    • Latent

      public Latent(MethodDescription.InDefinedShape declaringMethod, ParameterDescription.Token token, int index, int offset)
      Creates a latent parameter description. All provided types are attached to this instance before they are returned.
      Parameters:
      declaringMethod - The method that is declaring the parameter.
      token - The token describing the shape of the parameter.
      index - The index of the parameter.
      offset - The parameter's offset in the local method variables array.
    • Latent

      public Latent(MethodDescription.InDefinedShape declaringMethod, TypeDescription.Generic parameterType, int index, int offset)
      Creates a new latent parameter descriptions for a parameter without explicit meta data or annotations.
      Parameters:
      declaringMethod - The method declaring this parameter.
      parameterType - The type of the parameter.
      index - The index of the parameter.
      offset - The offset of the parameter.
    • Latent

      public Latent(MethodDescription.InDefinedShape declaringMethod, TypeDescription.Generic parameterType, List<? extends AnnotationDescription> declaredAnnotations, @MaybeNull String name, @MaybeNull Integer modifiers, int index, int offset)
      Creates a latent parameter description. All provided types are attached to this instance before they are returned.
      Parameters:
      declaringMethod - The method that is declaring the parameter.
      parameterType - The parameter's type.
      declaredAnnotations - The annotations of the parameter.
      name - The name of the parameter or null if no name is explicitly defined.
      modifiers - The modifiers of the parameter or null if no modifiers are explicitly defined.
      index - The index of the parameter.
      offset - The parameter's offset in the local method variables array.
  • Method Details

    • getType

      public TypeDescription.Generic getType()
      Returns the type of this parameter.
      Returns:
      The type of this parameter.
    • getDeclaringMethod

      public MethodDescription.InDefinedShape getDeclaringMethod()
      Returns the method that declares this parameter.
      Returns:
      The method that declares this parameter.
    • getIndex

      public int getIndex()
      Returns this parameter's index.
      Returns:
      The index of this parameter.
    • getOffset

      public int getOffset()
      Returns the offset to the parameter value within the local method variable.
      Specified by:
      getOffset in interface ParameterDescription
      Overrides:
      getOffset in class ParameterDescription.AbstractBase
      Returns:
      The offset of this parameter's value.
    • isNamed

      public boolean isNamed()
      Returns true if this element has an explicit name.
      Returns:
      true if this element has an explicit name.
    • hasModifiers

      public boolean hasModifiers()
      Checks if this parameter has an explicit modifier. A parameter without a modifier is simply treated as if it had a modifier of zero.
      Returns:
      true if this parameter defines explicit modifiers.
    • getName

      public String getName()
      Returns the binary name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.
      Specified by:
      getName in interface NamedElement.WithRuntimeName
      Overrides:
      getName in class ParameterDescription.AbstractBase
      Returns:
      The binary ame of this byte code element as visible from within a running Java application.
    • getModifiers

      public int getModifiers()
      Returns the modifier that is described by this object.
      Specified by:
      getModifiers in interface ModifierReviewable
      Overrides:
      getModifiers in class ParameterDescription.AbstractBase
      Returns:
      The modifier that is described by this object.
    • getDeclaredAnnotations

      public AnnotationList getDeclaredAnnotations()
      Returns a list of annotations that are declared by this instance.
      Returns:
      A list of declared annotations.