Class ScalaClassElement

java.lang.Object
io.micronaut.scala.processing.visitor.ScalaClassElement
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.ArrayableClassElement, io.micronaut.inject.ast.ClassElement, io.micronaut.inject.ast.Element, io.micronaut.inject.ast.TypedElement

public class ScalaClassElement extends Object implements io.micronaut.inject.ast.ArrayableClassElement
Scala class element backed by compiler plugin model data.
  • 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.ClassElement

    ZERO_CLASS_ELEMENTS

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

    EMPTY_ELEMENT_ARRAY

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

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.inject.ast.beans.BeanElementBuilder
    addAssociatedBean(io.micronaut.inject.ast.ClassElement type)
     
    <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
     
    Map<String, Map<String, io.micronaut.inject.ast.ClassElement>>
     
    io.micronaut.core.annotation.AnnotationMetadata
     
    protected io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<?>
     
    int
     
    List<io.micronaut.inject.ast.PropertyElement>
     
    List<io.micronaut.inject.ast.PropertyElement>
    getBeanProperties(io.micronaut.inject.ast.PropertyElementQuery propertyElementQuery)
     
    The source-level name of the type, with nested types separated by a dot.
    List<? extends io.micronaut.inject.ast.GenericPlaceholderElement>
     
    Optional<io.micronaut.inject.ast.MethodElement>
     
    getDocumentation(boolean parse)
     
    protected io.micronaut.inject.ast.annotation.ElementAnnotationMetadata
     
    <T extends io.micronaut.inject.ast.Element>
    List<T>
    getEnclosedElements(io.micronaut.inject.ast.ElementQuery<T> query)
     
    Optional<io.micronaut.inject.ast.ClassElement>
     
    Collection<io.micronaut.inject.ast.ClassElement>
     
    Set<io.micronaut.inject.ast.ElementModifier>
     
     
     
    io.micronaut.inject.ast.PackageElement
     
     
    Optional<io.micronaut.inject.ast.MethodElement>
     
    Optional<io.micronaut.inject.ast.ClassElement>
     
    List<io.micronaut.inject.ast.PropertyElement>
     
    io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.core.annotation.AnnotationMetadata>
     
    Map<String, io.micronaut.inject.ast.ClassElement>
     
    int
     
    boolean
     
    boolean
    isAssignable(io.micronaut.inject.ast.ClassElement type)
    Whether this element is assignable to the given element, which unlike a name can be an array.
    boolean
    Whether this element is assignable to the named type.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    A Java record, which is the one kind of class that extends java.lang.Record: the language allows no other, and the compiler recognises a record the same way.
    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.ClassElement
    withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
     
    io.micronaut.inject.ast.ClassElement
    withArrayDimensions(int arrayDimensions)
     
    io.micronaut.inject.ast.ClassElement
    withTypeArguments(Map<String, io.micronaut.inject.ast.ClassElement> typeArguments)
     

    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, isNonNull, 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.ArrayableClassElement

    fromArray, toArray

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

    findDefaultStaticCreator, findField, findMethod, findStaticCreator, foldBoundGenericTypes, getAccessibleConstructors, getAccessibleStaticCreators, getBoundGenericTypes, getEnclosedElement, getFields, getFirstTypeArgument, getMethods, getOptionalValueType, getPermittedSubclasses, getRawClassElement, getSimpleName, getType, getTypeArguments, getTypeArguments, hasUnresolvedTypes, isAssignable, isGenericPlaceholder, isIterable, isOptional, isProxy, isRawType, isSealed, isTypeVariable, isWildcard, withBoundGenericTypes, withTypeArguments

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

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

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

    getGenericType, isArray, isVoid
  • Method Details

    • isInterface

      public boolean isInterface()
      Specified by:
      isInterface in interface io.micronaut.inject.ast.ClassElement
    • isEnum

      public boolean isEnum()
      Specified by:
      isEnum in interface io.micronaut.inject.ast.ClassElement
    • isRecord

      public boolean isRecord()
      A Java record, which is the one kind of class that extends java.lang.Record: the language allows no other, and the compiler recognises a record the same way. Scala has no records, so this is only ever true of a class read from the classpath.
      Specified by:
      isRecord in interface io.micronaut.inject.ast.ClassElement
    • getTypeAnnotationMetadata

      public io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.core.annotation.AnnotationMetadata> getTypeAnnotationMetadata()
      Specified by:
      getTypeAnnotationMetadata in interface io.micronaut.inject.ast.ClassElement
    • isAssignable

      public boolean isAssignable(String type)
      Whether this element is assignable to the named type.

      A type name carries no array dimensions -- an element for Array[String] is named java.lang.String and reports one dimension separately -- so this used to answer for the component type and call Array[String] assignable to String, and Array[Array[String]] assignable to Array[String]. Micronaut matches bean types, @Requires conditions and executable handlers through this method, so an array bean satisfied an injection point for its component type. An array is assignable by name only to the three types every array really is.

      Specified by:
      isAssignable in interface io.micronaut.inject.ast.ClassElement
    • isAssignable

      public boolean isAssignable(io.micronaut.inject.ast.ClassElement type)
      Whether this element is assignable to the given element, which unlike a name can be an array. Core's default delegates to isAssignable(String), which discards the dimensions of both sides.
      Specified by:
      isAssignable in interface io.micronaut.inject.ast.ClassElement
    • getSuperType

      public Optional<io.micronaut.inject.ast.ClassElement> getSuperType()
      Specified by:
      getSuperType in interface io.micronaut.inject.ast.ClassElement
    • getInterfaces

      public Collection<io.micronaut.inject.ast.ClassElement> getInterfaces()
      Specified by:
      getInterfaces in interface io.micronaut.inject.ast.ClassElement
    • isInner

      public boolean isInner()
      Specified by:
      isInner in interface io.micronaut.inject.ast.ClassElement
    • getEnclosingType

      public Optional<io.micronaut.inject.ast.ClassElement> getEnclosingType()
      Specified by:
      getEnclosingType in interface io.micronaut.inject.ast.ClassElement
    • addAssociatedBean

      public io.micronaut.inject.ast.beans.BeanElementBuilder addAssociatedBean(io.micronaut.inject.ast.ClassElement type)
      Specified by:
      addAssociatedBean in interface io.micronaut.inject.ast.ClassElement
    • getTypeArguments

      public Map<String, io.micronaut.inject.ast.ClassElement> getTypeArguments()
      Specified by:
      getTypeArguments in interface io.micronaut.inject.ast.ClassElement
    • getDeclaredGenericPlaceholders

      public List<? extends io.micronaut.inject.ast.GenericPlaceholderElement> getDeclaredGenericPlaceholders()
      Specified by:
      getDeclaredGenericPlaceholders in interface io.micronaut.inject.ast.ClassElement
    • getBeanProperties

      public List<io.micronaut.inject.ast.PropertyElement> getBeanProperties()
      Specified by:
      getBeanProperties in interface io.micronaut.inject.ast.ClassElement
    • getSyntheticBeanProperties

      public List<io.micronaut.inject.ast.PropertyElement> getSyntheticBeanProperties()
      Specified by:
      getSyntheticBeanProperties in interface io.micronaut.inject.ast.ClassElement
    • getBeanProperties

      public List<io.micronaut.inject.ast.PropertyElement> getBeanProperties(io.micronaut.inject.ast.PropertyElementQuery propertyElementQuery)
      Specified by:
      getBeanProperties in interface io.micronaut.inject.ast.ClassElement
    • getPrimaryConstructor

      public Optional<io.micronaut.inject.ast.MethodElement> getPrimaryConstructor()
      Specified by:
      getPrimaryConstructor in interface io.micronaut.inject.ast.ClassElement
    • getDefaultConstructor

      public Optional<io.micronaut.inject.ast.MethodElement> getDefaultConstructor()
      Specified by:
      getDefaultConstructor in interface io.micronaut.inject.ast.ClassElement
    • getEnclosedElements

      public <T extends io.micronaut.inject.ast.Element> List<T> getEnclosedElements(io.micronaut.inject.ast.ElementQuery<T> query)
      Specified by:
      getEnclosedElements in interface io.micronaut.inject.ast.ClassElement
    • getPackageName

      public String getPackageName()
      Specified by:
      getPackageName in interface io.micronaut.inject.ast.ClassElement
    • getCanonicalName

      public String getCanonicalName()
      The source-level name of the type, with nested types separated by a dot.

      Core's default returns Element.getName(), which is the binary name -- nest.Outer$Inner. The Java module answers with the qualified name, nest.Outer.Inner, and this is what reaches users in diagnostics and in introspection naming.

      Specified by:
      getCanonicalName in interface io.micronaut.inject.ast.ClassElement
    • getPackage

      public io.micronaut.inject.ast.PackageElement getPackage()
      Specified by:
      getPackage in interface io.micronaut.inject.ast.ClassElement
    • withArrayDimensions

      public io.micronaut.inject.ast.ClassElement withArrayDimensions(int arrayDimensions)
      Specified by:
      withArrayDimensions in interface io.micronaut.inject.ast.ArrayableClassElement
    • getArrayDimensions

      public int getArrayDimensions()
      Specified by:
      getArrayDimensions in interface io.micronaut.inject.ast.TypedElement
    • isPrimitive

      public boolean isPrimitive()
      Specified by:
      isPrimitive in interface io.micronaut.inject.ast.TypedElement
    • isContainerType

      public boolean isContainerType()
      Specified by:
      isContainerType in interface io.micronaut.inject.ast.ClassElement
    • getAllTypeArguments

      public Map<String, Map<String, io.micronaut.inject.ast.ClassElement>> getAllTypeArguments()
      Specified by:
      getAllTypeArguments in interface io.micronaut.inject.ast.ClassElement
    • withTypeArguments

      public io.micronaut.inject.ast.ClassElement withTypeArguments(Map<String, io.micronaut.inject.ast.ClassElement> typeArguments)
      Specified by:
      withTypeArguments in interface io.micronaut.inject.ast.ClassElement
    • withAnnotationMetadata

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

      protected Class<?> equalityType()
    • equalityKey

      protected Object equalityKey()
    • rawDocumentation

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

      public Optional<String> getDocumentation(boolean parse)
      Specified by:
      getDocumentation in interface io.micronaut.inject.ast.Element
    • 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