Package io.micronaut.openapi.visitor
Class ElementUtils
java.lang.Object
io.micronaut.openapi.visitor.ElementUtils
Some util methods.
- Since:
- 4.8.3
-
Field Summary
Modifier and TypeFieldDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Field Details
-
CONTAINER_TYPES
-
FILE_TYPES
-
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
- elementclassElement
- 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)
-