Package io.micronaut.openapi.visitor
Class Utils
- java.lang.Object
-
- io.micronaut.openapi.visitor.Utils
-
public final class Utils extends java.lang.ObjectSome util methods.- Since:
- 4.4.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_OPENAPIstatic java.lang.StringATTR_TEST_MODEstatic java.lang.StringATTR_VISITED_ELEMENTSstatic java.util.List<io.micronaut.http.MediaType>DEFAULT_MEDIA_TYPESstatic java.lang.StringPLACEHOLDER_POSTFIXstatic java.lang.StringPLACEHOLDER_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JavadocParsergetJavadocParser()static java.nio.file.PathgetProjectPath(io.micronaut.inject.visitor.VisitorContext context)static io.micronaut.context.env.PropertyPlaceholderResolvergetPropertyPlaceholderResolver()static java.lang.StringgetTestJsonReference()static io.swagger.v3.oas.models.OpenAPIgetTestReference()static io.swagger.v3.oas.models.OpenAPIgetTestReferenceAfterPlaceholders()static java.lang.StringgetTestYamlReference()static booleanisContainerType(io.micronaut.inject.ast.ClassElement type)static booleanisReturnTypeFile(io.micronaut.inject.ast.ClassElement type)static booleanisTestMode()static <T extends java.lang.Enum<T>>
voidnormalizeEnumValues(java.util.Map<java.lang.CharSequence,java.lang.Object> paramValues, java.util.Map<java.lang.String,java.lang.Class<T>> enumTypes)Normalizes enum values stored in the map.static io.swagger.v3.oas.models.ComponentsresolveComponents(io.swagger.v3.oas.models.OpenAPI openAPI)Resolve the components.static io.swagger.v3.oas.models.OpenAPIresolveOpenAPI(io.micronaut.inject.visitor.VisitorContext context)Resolve theOpenAPIinstance.static voidsetJavadocParser(JavadocParser javadocParser)static voidsetTestJsonReference(java.lang.String testJsonReference)static voidsetTestReference(io.swagger.v3.oas.models.OpenAPI testReference)static voidsetTestReferenceAfterPlaceholders(io.swagger.v3.oas.models.OpenAPI testReferenceAfterPlaceholders)static voidsetTestYamlReference(java.lang.String testYamlReference)
-
-
-
Field Detail
-
PLACEHOLDER_PREFIX
public static final java.lang.String PLACEHOLDER_PREFIX
- See Also:
- Constant Field Values
-
PLACEHOLDER_POSTFIX
public static final java.lang.String PLACEHOLDER_POSTFIX
- See Also:
- Constant Field Values
-
ATTR_OPENAPI
public static final java.lang.String ATTR_OPENAPI
- See Also:
- Constant Field Values
-
ATTR_TEST_MODE
public static final java.lang.String ATTR_TEST_MODE
- See Also:
- Constant Field Values
-
ATTR_VISITED_ELEMENTS
public static final java.lang.String ATTR_VISITED_ELEMENTS
- See Also:
- Constant Field Values
-
DEFAULT_MEDIA_TYPES
public static final java.util.List<io.micronaut.http.MediaType> DEFAULT_MEDIA_TYPES
-
-
Method Detail
-
getProjectPath
public static java.nio.file.Path getProjectPath(io.micronaut.inject.visitor.VisitorContext context)
-
getPropertyPlaceholderResolver
public static io.micronaut.context.env.PropertyPlaceholderResolver getPropertyPlaceholderResolver()
- Returns:
- An Instance of sdefault
PropertyPlaceholderResolverto resolve placeholders.
-
isContainerType
public static boolean isContainerType(io.micronaut.inject.ast.ClassElement type)
-
isReturnTypeFile
public static boolean isReturnTypeFile(io.micronaut.inject.ast.ClassElement type)
-
normalizeEnumValues
public static <T extends java.lang.Enum<T>> void normalizeEnumValues(java.util.Map<java.lang.CharSequence,java.lang.Object> paramValues, java.util.Map<java.lang.String,java.lang.Class<T>> enumTypes)Normalizes enum values stored in the map.- Type Parameters:
T- enum class- Parameters:
paramValues- The valuesenumTypes- The enum types.
-
resolveComponents
public static io.swagger.v3.oas.models.Components resolveComponents(io.swagger.v3.oas.models.OpenAPI openAPI)
Resolve the components.- Parameters:
openAPI- The open API- Returns:
- The components
-
resolveOpenAPI
public static io.swagger.v3.oas.models.OpenAPI resolveOpenAPI(io.micronaut.inject.visitor.VisitorContext context)
Resolve theOpenAPIinstance.- Parameters:
context- The context- Returns:
- The
OpenAPIinstance
-
isTestMode
public static boolean isTestMode()
-
getTestReference
public static io.swagger.v3.oas.models.OpenAPI getTestReference()
-
setTestReference
public static void setTestReference(io.swagger.v3.oas.models.OpenAPI testReference)
-
getTestReferenceAfterPlaceholders
public static io.swagger.v3.oas.models.OpenAPI getTestReferenceAfterPlaceholders()
-
setTestReferenceAfterPlaceholders
public static void setTestReferenceAfterPlaceholders(io.swagger.v3.oas.models.OpenAPI testReferenceAfterPlaceholders)
-
getTestYamlReference
public static java.lang.String getTestYamlReference()
-
setTestYamlReference
public static void setTestYamlReference(java.lang.String testYamlReference)
-
getTestJsonReference
public static java.lang.String getTestJsonReference()
-
setTestJsonReference
public static void setTestJsonReference(java.lang.String testJsonReference)
-
getJavadocParser
public static JavadocParser getJavadocParser()
-
setJavadocParser
public static void setJavadocParser(JavadocParser javadocParser)
-
-