Interface TypedElement

All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Element, MutableAnnotationMetadataDelegate<Element>, Named
All Known Subinterfaces:
AnnotationElement, ArrayableClassElement, BeanFieldElement, BeanParameterElement, ClassElement, EnumConstantElement, EnumElement, FieldElement, GenericElement, GenericPlaceholderElement, KotlinParameterElement, ParameterElement, PropertyElement, WildcardElement
All Known Implementing Classes:
GroovyClassElement, GroovyEnumConstantElement, GroovyFieldElement, GroovyParameterElement, JavaClassElement, PrimitiveElement

public interface TypedElement extends Element
An element that has an underlying type.
Since:
1.0
Author:
graemerocher
See Also:
  • Method Details

    • getType

      Returns:
      The type of the element
    • getGenericType

      @NonNull default @NonNull ClassElement getGenericType()
      Returns the generic type of the element. This differs from getType() as it returns the actual type without erasure. Whilst 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.
      Returns:
      The generic type
      Since:
      1.1.1
    • isPrimitive

      default boolean isPrimitive()
      Whether the type is primitive.
      Returns:
      True if it is
    • isVoid

      default boolean isVoid()
      Whether the type is void.
      Returns:
      True if it is
      Since:
      4.0.0
    • isArray

      default boolean isArray()
      Is the type an array.
      Returns:
      True if it is.
    • getArrayDimensions

      default int getArrayDimensions()
      If the type is an array, the number of dimensions. String[] should return 1, String[][] should return 2
      Returns:
      The number of dimensions