Class ScalaParameterElement

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

public final class ScalaParameterElement extends Object implements io.micronaut.inject.ast.ParameterElement
Scala parameter element.
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY

    Fields inherited from interface io.micronaut.inject.ast.Element

    EMPTY_ELEMENT_ARRAY

    Fields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate

    EMPTY

    Fields inherited from interface io.micronaut.inject.ast.ParameterElement

    ZERO_PARAMETER_ELEMENTS
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Annotation>
    io.micronaut.inject.ast.Element
    annotate(io.micronaut.core.annotation.AnnotationValue<T> annotationValue)
     
    <T extends Annotation>
    io.micronaut.inject.ast.Element
    annotate(String annotationType, Consumer<io.micronaut.core.annotation.AnnotationValueBuilder<T>> consumer)
     
    protected Object
     
    protected Class<?>
     
    boolean
     
    io.micronaut.core.annotation.AnnotationMetadata
     
    protected io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<?>
     
    getDocumentation(boolean parse)
    The documentation of this parameter, which is a tag on whatever declares it.
    protected io.micronaut.inject.ast.annotation.ElementAnnotationMetadata
     
    io.micronaut.inject.ast.ClassElement
    The type with the declaring type's variables bound as they were where the method was reached: Book for the E of a method inherited through Repo[Book, Long].
    io.micronaut.inject.ast.MethodElement
     
    Set<io.micronaut.inject.ast.ElementModifier>
     
     
     
    io.micronaut.inject.ast.ClassElement
     
    boolean
    Whether this parameter declares a default value that a caller can supply.
    int
     
    boolean
     
    boolean
     
    boolean
    A parameter is null-marked when the method that declares it is: `@NullMarked` on a class reaches a parameter only through the method, the same route the Java module takes.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    protected Optional<String>
     
    io.micronaut.inject.ast.Element
    removeAnnotation(String annotationType)
     
    <T extends Annotation>
    io.micronaut.inject.ast.Element
    removeAnnotationIf(Predicate<io.micronaut.core.annotation.AnnotationValue<T>> predicate)
     
    io.micronaut.inject.ast.Element
    removeStereotype(String annotationType)
     
    io.micronaut.inject.ast.ParameterElement
    withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement

    isDeclaredNonNull, isDeclaredNullable, isNullable

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate

    booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasEvaluatedExpressions, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    getAnnotationMetadata

    Methods inherited from interface io.micronaut.inject.ast.Element

    annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getModifiers, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype

    Methods inherited from interface io.micronaut.inject.ast.ParameterElement

    getDescription

    Methods inherited from interface io.micronaut.inject.ast.TypedElement

    getArrayDimensions, isArray, isPrimitive, isVoid
  • Method Details

    • hasDefault

      public boolean hasDefault()
      Whether this parameter declares a default value that a caller can supply.

      Reports a default only when the generated accessor is reachable from a call site; see defaultAccessor in the extractor. Core pairs this with a ParameterDefaultValueProvider, which ScalaParameterDefaultValueProvider supplies.

      Specified by:
      hasDefault in interface io.micronaut.inject.ast.ParameterElement
    • getDocumentation

      public Optional<String> getDocumentation(boolean parse)
      The documentation of this parameter, which is a tag on whatever declares it.

      A parameter carries no comment of its own in any language Micronaut supports; it is documented by a @param tag on its method. Scala adds a second place to look, and it is the one that matters most here: the parameters of a case class are its properties, so a @ConfigurationProperties case class documents each property as a @param tag on the class. That is where the description in the generated configuration metadata comes from, and it is the same rule Java applies to records.

      Absent when parse is false, because a tag's text is only reachable by parsing the comment that contains it -- the same answer the Java implementation gives.

      Specified by:
      getDocumentation in interface io.micronaut.inject.ast.Element
      Parameters:
      parse - Whether the comment may be parsed
      Returns:
      The documentation for this parameter, if its declaration gives any
    • getType

      public io.micronaut.inject.ast.ClassElement getType()
      Specified by:
      getType in interface io.micronaut.inject.ast.ParameterElement
      Specified by:
      getType in interface io.micronaut.inject.ast.TypedElement
    • getGenericType

      public io.micronaut.inject.ast.ClassElement getGenericType()
      The type with the declaring type's variables bound as they were where the method was reached: Book for the E of a method inherited through Repo[Book, Long]. getType() stays the declared type -- the JVM signature an override has to be declared with.
      Specified by:
      getGenericType in interface io.micronaut.inject.ast.TypedElement
    • getMethodElement

      public io.micronaut.inject.ast.MethodElement getMethodElement()
      Specified by:
      getMethodElement in interface io.micronaut.inject.ast.ParameterElement
    • withAnnotationMetadata

      public io.micronaut.inject.ast.ParameterElement withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Specified by:
      withAnnotationMetadata in interface io.micronaut.inject.ast.Element
      Specified by:
      withAnnotationMetadata in interface io.micronaut.inject.ast.ParameterElement
    • equalityKey

      protected Object equalityKey()
    • isNonNull

      public boolean isNonNull()
      A parameter is null-marked when the method that declares it is: `@NullMarked` on a class reaches a parameter only through the method, the same route the Java module takes.
      Specified by:
      isNonNull in interface io.micronaut.core.annotation.AnnotatedElement
    • rawDocumentation

      protected Optional<String> rawDocumentation()
      Returns:
      The raw Scaladoc comment written on this element, if any
    • getName

      public String getName()
      Specified by:
      getName in interface io.micronaut.inject.ast.Element
      Specified by:
      getName in interface io.micronaut.core.naming.Named
    • isProtected

      public boolean isProtected()
      Specified by:
      isProtected in interface io.micronaut.inject.ast.Element
    • isPublic

      public boolean isPublic()
      Specified by:
      isPublic in interface io.micronaut.inject.ast.Element
    • isPrivate

      public boolean isPrivate()
      Specified by:
      isPrivate in interface io.micronaut.inject.ast.Element
    • isPackagePrivate

      public boolean isPackagePrivate()
      Specified by:
      isPackagePrivate in interface io.micronaut.inject.ast.Element
    • isAbstract

      public boolean isAbstract()
      Specified by:
      isAbstract in interface io.micronaut.inject.ast.Element
    • isStatic

      public boolean isStatic()
      Specified by:
      isStatic in interface io.micronaut.inject.ast.Element
    • isFinal

      public boolean isFinal()
      Specified by:
      isFinal in interface io.micronaut.inject.ast.Element
    • getModifiers

      public Set<io.micronaut.inject.ast.ElementModifier> getModifiers()
      Specified by:
      getModifiers in interface io.micronaut.inject.ast.Element
    • getNativeType

      public Object getNativeType()
      Specified by:
      getNativeType in interface io.micronaut.inject.ast.Element
    • getAnnotationMetadata

      public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • getElementAnnotationMetadata

      protected io.micronaut.inject.ast.annotation.ElementAnnotationMetadata getElementAnnotationMetadata()
    • getAnnotationMetadataToWrite

      protected io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<?> getAnnotationMetadataToWrite()
    • annotate

      public <T extends Annotation> io.micronaut.inject.ast.Element annotate(String annotationType, Consumer<io.micronaut.core.annotation.AnnotationValueBuilder<T>> consumer)
      Specified by:
      annotate in interface io.micronaut.inject.ast.Element
      Specified by:
      annotate in interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>
    • annotate

      public <T extends Annotation> io.micronaut.inject.ast.Element annotate(io.micronaut.core.annotation.AnnotationValue<T> annotationValue)
      Specified by:
      annotate in interface io.micronaut.inject.ast.Element
      Specified by:
      annotate in interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>
    • removeAnnotation

      public io.micronaut.inject.ast.Element removeAnnotation(String annotationType)
      Specified by:
      removeAnnotation in interface io.micronaut.inject.ast.Element
      Specified by:
      removeAnnotation in interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>
    • removeAnnotationIf

      public <T extends Annotation> io.micronaut.inject.ast.Element removeAnnotationIf(Predicate<io.micronaut.core.annotation.AnnotationValue<T>> predicate)
      Specified by:
      removeAnnotationIf in interface io.micronaut.inject.ast.Element
      Specified by:
      removeAnnotationIf in interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>
    • removeStereotype

      public io.micronaut.inject.ast.Element removeStereotype(String annotationType)
      Specified by:
      removeStereotype in interface io.micronaut.inject.ast.Element
      Specified by:
      removeStereotype in interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equalityType

      protected Class<?> equalityType()