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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<String>
     
    static final List<String>
     
    static final List<String>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isAnnotationPresent(io.micronaut.inject.ast.Element element, String className)
     
    static boolean
    isContainerType(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is container.
    static boolean
    isElementNotNullable(io.micronaut.inject.ast.Element element, @Nullable io.micronaut.inject.ast.Element classElement)
    Checking if the element not nullable.
    static boolean
    isFileUpload(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is file upload type.
    static boolean
    isIgnoredParameter(io.micronaut.inject.ast.TypedElement parameter)
     
    static boolean
    isIgnoredParameterType(io.micronaut.inject.ast.ClassElement parameterType)
     
    static boolean
    isJavaElement(io.micronaut.inject.ast.ClassElement classElement, io.micronaut.inject.visitor.VisitorContext context)
    Returns true if classElement is a JavaClassElement.
    static boolean
    isNullable(io.micronaut.inject.ast.TypedElement element)
    Checks Nullable annotations / optional type to understand that the element can be null.
    static boolean
    isReactiveAndVoid(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is void.
    static boolean
    isReturnTypeFile(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is file.
    static boolean
    isVoid(io.micronaut.inject.ast.ClassElement type)
    Checking if the type is void.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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

    • isJavaElement

      public static boolean isJavaElement(io.micronaut.inject.ast.ClassElement classElement, io.micronaut.inject.visitor.VisitorContext context)
      Returns true if classElement is a JavaClassElement.
      Parameters:
      classElement - A ClassElement.
      context - The context.
      Returns:
      true if classElement is a JavaClassElement.
    • 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.
    • isAnnotationPresent

      public static boolean isAnnotationPresent(io.micronaut.inject.ast.Element element, String className)
    • 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
    • isElementNotNullable

      public static boolean isElementNotNullable(io.micronaut.inject.ast.Element element, @Nullable @Nullable io.micronaut.inject.ast.Element classElement)
      Checking if the element not nullable.
      Parameters:
      element - element
      classElement - class 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)
    • isIgnoredParameterType

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