Class PythonParameterElement

java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.python.processing.visitor.PythonParameterElement
All Implemented Interfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Named, MutableAnnotationMetadataDelegate<Element>, Element, ParameterElement, TypedElement

public final class PythonParameterElement extends AbstractAnnotationElement implements ParameterElement
A parameter element representing a Python function parameter.

This class wraps parameter information from a Python function argument, providing type resolution and metadata for Micronaut's parameter processing.

Since:
5.2.0
Author:
Micronaut Team
  • Constructor Details

  • Method Details

    • getNativeType

      public ArgumentDef getNativeType()
      Description copied from interface: Element
      Returns the native underlying type. This API is extended by all inject language implementations. The object returned by this method will be the language native type the information is being retrieved from.
      Specified by:
      getNativeType in interface Element
      Returns:
      The native type
    • getType

      public ClassElement getType()
      Specified by:
      getType in interface ParameterElement
      Specified by:
      getType in interface TypedElement
      Returns:
      The type of the parameter
    • getGenericType

      public ClassElement getGenericType()
      Description copied from interface: TypedElement
      Returns the generic type of the element. This differs from TypedElement.getType() as it returns the actual type without erasure. Whilst TypedElement.getType() is often needed to produce the correct byte code when generating code via ASM, the getGenericType() method is more useful for documentation and other types of code generation.
      Specified by:
      getGenericType in interface TypedElement
      Returns:
      The generic type
    • getMethodElement

      public PythonMethodElement getMethodElement()
      Description copied from interface: ParameterElement
      Return method associated with this parameter.
      Specified by:
      getMethodElement in interface ParameterElement
      Returns:
      The method element
    • getDocumentation

      public Optional<String> getDocumentation(boolean parseContent)
      Specified by:
      getDocumentation in interface Element
      Parameters:
      parseContent - True if the content should be parsed to extract documentation
      Returns:
      The documentation, if any.
    • copyThis

      protected io.micronaut.python.processing.visitor.AbstractPythonElement copyThis()
      Returns:
      copy of this element
    • withAnnotationMetadata

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

      protected void copyValues(io.micronaut.python.processing.visitor.AbstractPythonElement element)
      Parameters:
      element - the values to be copied to
    • makeCopy

      protected final io.micronaut.python.processing.visitor.AbstractPythonElement makeCopy()
    • getName

      public String getName()
      Specified by:
      getName in interface Element
      Specified by:
      getName in interface Named
      Returns:
      The name of the element. For a type this represents the binary name.
    • isProtected

      public boolean isProtected()
      Specified by:
      isProtected in interface Element
      Returns:
      True if the element is protected.
    • isPublic

      public boolean isPublic()
      Specified by:
      isPublic in interface Element
      Returns:
      True if the element is public.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object