Interface ParameterElement

All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Element, MutableAnnotationMetadataDelegate<Element>, Named, TypedElement
All Known Subinterfaces:
BeanParameterElement, KotlinParameterElement
All Known Implementing Classes:
GroovyParameterElement

public interface ParameterElement extends TypedElement
Represents a parameter to a method or constructor.
Since:
1.0
Author:
graemerocher
  • Field Details

    • ZERO_PARAMETER_ELEMENTS

      static final ParameterElement[] ZERO_PARAMETER_ELEMENTS
      Constant for an empty parameter element array.
      Since:
      4.4.0
  • Method Details

    • getType

      @NonNull ClassElement getType()
      Specified by:
      getType in interface TypedElement
      Returns:
      The type of the parameter
    • getDescription

      default @NonNull String getDescription(boolean simple)
      Description copied from interface: Described
      Allows returning a more simple description if requested.
      Specified by:
      getDescription in interface Described
      Specified by:
      getDescription in interface Element
      Parameters:
      simple - True if a simple description is required
      Returns:
      The simple description
    • getMethodElement

      default MethodElement getMethodElement()
      Return method associated with this parameter.
      Returns:
      The method element
    • withAnnotationMetadata

      default ParameterElement withAnnotationMetadata(AnnotationMetadata annotationMetadata)
      Description copied from interface: Element
      Copies this element and overrides its annotations.
      Specified by:
      withAnnotationMetadata in interface Element
      Parameters:
      annotationMetadata - The annotation metadata
      Returns:
      A new element
    • of

      static @NonNull ParameterElement of(@NonNull Class<?> type, @NonNull String name)
      Creates a parameter element for a simple type and name.
      Parameters:
      type - The type
      name - The name
      Returns:
      The parameter element
    • of

      static @NonNull ParameterElement of(@NonNull ClassElement type, @NonNull String name)
      Creates a parameter element for the given arguments.
      Parameters:
      type - The element type
      name - The name
      Returns:
      The parameter element
      Since:
      2.4.0
    • of

      static @NonNull ParameterElement of(@NonNull ClassElement type, @NonNull String name, @NonNull AnnotationMetadataProvider annotationMetadataProvider, @NonNull AbstractAnnotationMetadataBuilder<?,?> metadataBuilder)
      Creates a parameter element for the given arguments.
      Parameters:
      type - The element type
      name - The name
      annotationMetadataProvider - The name
      metadataBuilder - The name
      Returns:
      The parameter element
      Since:
      4.0.0