Class ElementUtils

java.lang.Object
io.micronaut.openapi.visitor.ElementUtils

@Internal public final class ElementUtils extends Object
Some util methods.
Since:
4.8.3
  • Field Details

    • EMPTY_ANNOTATION_VALUES_ARRAY

      public static final io.micronaut.core.annotation.AnnotationValue<?>[] EMPTY_ANNOTATION_VALUES_ARRAY
    • CONTAINER_TYPES

      public static final List<String> CONTAINER_TYPES
    • FILE_TYPES

      public static final List<String> FILE_TYPES
    • VOID_TYPES

      public static final List<String> VOID_TYPES
  • Method Details

    • isSingleResponseType

      public static boolean isSingleResponseType(io.micronaut.inject.ast.ClassElement returnType)
    • isResponseType

      public static boolean isResponseType(io.micronaut.inject.ast.ClassElement returnType)
    • isNullable

      public static boolean isNullable(io.micronaut.inject.ast.TypedElement element)
      Checks Nullable annotations / optional type to understand that the element can be null.
      Parameters:
      element - typed element
      Returns:
      true if element is nullable, false - otherwise.
    • isFileUpload

      public static boolean isFileUpload(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is file upload type.
      Parameters:
      type - type element
      Returns:
      true if this type one of known file upload types
    • isNotNullable

      public static boolean isNotNullable(io.micronaut.inject.ast.Element element)
      Checking if the element not nullable.
      Parameters:
      element - element
      Returns:
      true if element is not nullable
    • isReturnTypeFile

      public static boolean isReturnTypeFile(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is file.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known file types
    • isContainerType

      public static boolean isContainerType(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is container.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known container types
    • isVoid

      public static boolean isVoid(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is void.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known void types
    • isReactiveAndVoid

      public static boolean isReactiveAndVoid(io.micronaut.inject.ast.ClassElement type)
      Checking if the type is void.
      Parameters:
      type - type element
      Returns:
      true if this type assignable with known container and type argument is void
    • isIgnoredParameter

      public static boolean isIgnoredParameter(io.micronaut.inject.ast.TypedElement parameter)
    • isJavaBasicType

      public static boolean isJavaBasicType(String typeName)
    • isIgnoredParameterType

      public static boolean isIgnoredParameterType(io.micronaut.inject.ast.ClassElement parameterType)
    • getAnnotationMetadata

      public static io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata(io.micronaut.inject.ast.Element el)
    • findAnnotation

      public static Optional<io.micronaut.core.annotation.AnnotationValue<Annotation>> findAnnotation(io.micronaut.inject.ast.Element el, String annName)
    • isAnnotationPresent

      public static <T> boolean isAnnotationPresent(io.micronaut.inject.ast.Element el, Class<T> annClass)
    • isAnnotationPresent

      public static boolean isAnnotationPresent(io.micronaut.inject.ast.Element el, String annName)
    • stringValue

      public static <T extends Annotation> Optional<String> stringValue(io.micronaut.inject.ast.Element el, Class<T> annClass, String member)
    • getAnnotation

      public static <T extends Annotation> io.micronaut.core.annotation.AnnotationValue<T> getAnnotation(io.micronaut.inject.ast.Element el, Class<T> annClass)
    • getAnnotation

      public static io.micronaut.core.annotation.AnnotationValue getAnnotation(io.micronaut.inject.ast.Element el, String annName)
    • getJsonViewClass

      public static io.micronaut.inject.ast.ClassElement getJsonViewClass(io.micronaut.inject.ast.Element element, io.micronaut.inject.visitor.VisitorContext context)
    • isTypeWithGenericNullable

      public static boolean isTypeWithGenericNullable(io.micronaut.inject.ast.ClassElement type)
    • isEnum

      public static boolean isEnum(io.micronaut.inject.ast.ClassElement classElement)