Package io.micronaut.inject.writer
Class ArgumentExpUtils
java.lang.Object
io.micronaut.inject.writer.ArgumentExpUtils
The argument expression utils.
- Since:
- 4.8
- Author:
- Denis Stepanov
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Method
static final io.micronaut.sourcegen.model.ClassTypeDef
static final io.micronaut.sourcegen.model.TypeDef.Array
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.micronaut.sourcegen.model.ExpressionDef
buildArgumentWithGenerics
(io.micronaut.sourcegen.model.TypeDef type, AnnotationMetadataReference annotationMetadata, ClassElement[] generics) Builds generic type arguments recursively.static io.micronaut.sourcegen.model.ExpressionDef
pushBuildArgumentsForMethod
(AnnotationMetadata annotationMetadataWithDefaults, ClassElement declaringElement, io.micronaut.sourcegen.model.ClassTypeDef owningType, Collection<ParameterElement> argumentTypes, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) static io.micronaut.sourcegen.model.ExpressionDef
pushCreateArgument
(AnnotationMetadata annotationMetadataWithDefaults, ClassElement declaringType, io.micronaut.sourcegen.model.ClassTypeDef owningType, String argumentName, ClassElement argument, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) Create a new Argument creation.static io.micronaut.sourcegen.model.ExpressionDef
pushReturnTypeArgument
(AnnotationMetadata annotationMetadataWithDefaults, io.micronaut.sourcegen.model.ClassTypeDef owningType, ClassElement declaringType, ClassElement argument, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) Creates an argument.
-
Field Details
-
TYPE_ARGUMENT
public static final io.micronaut.sourcegen.model.ClassTypeDef TYPE_ARGUMENT -
TYPE_ARGUMENT_ARRAY
public static final io.micronaut.sourcegen.model.TypeDef.Array TYPE_ARGUMENT_ARRAY -
METHOD_CREATE_ARGUMENT_SIMPLE
-
-
Constructor Details
-
ArgumentExpUtils
public ArgumentExpUtils()
-
-
Method Details
-
pushReturnTypeArgument
public static io.micronaut.sourcegen.model.ExpressionDef pushReturnTypeArgument(AnnotationMetadata annotationMetadataWithDefaults, io.micronaut.sourcegen.model.ClassTypeDef owningType, ClassElement declaringType, ClassElement argument, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) Creates an argument.- Parameters:
annotationMetadataWithDefaults
- The annotation metadata with defaultsowningType
- The owning typedeclaringType
- The declaring type nameargument
- The argumentloadClassValueExpressionFn
- The load type method fn- Returns:
- The expression
-
pushCreateArgument
public static io.micronaut.sourcegen.model.ExpressionDef pushCreateArgument(AnnotationMetadata annotationMetadataWithDefaults, ClassElement declaringType, io.micronaut.sourcegen.model.ClassTypeDef owningType, String argumentName, ClassElement argument, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) Create a new Argument creation.- Parameters:
annotationMetadataWithDefaults
- The annotation metadata with defaultsdeclaringType
- The declaring type nameowningType
- The owning typeargumentName
- The argument nameargument
- The argumentloadClassValueExpressionFn
- The load type methods fn- Returns:
- The expression
-
buildArgumentWithGenerics
public static io.micronaut.sourcegen.model.ExpressionDef buildArgumentWithGenerics(io.micronaut.sourcegen.model.TypeDef type, AnnotationMetadataReference annotationMetadata, ClassElement[] generics) Builds generic type arguments recursively.- Parameters:
type
- The type that declares the genericsannotationMetadata
- The annotation metadata referencegenerics
- The generics- Returns:
- The expression
-
pushBuildArgumentsForMethod
public static io.micronaut.sourcegen.model.ExpressionDef pushBuildArgumentsForMethod(AnnotationMetadata annotationMetadataWithDefaults, ClassElement declaringElement, io.micronaut.sourcegen.model.ClassTypeDef owningType, Collection<ParameterElement> argumentTypes, Function<String, io.micronaut.sourcegen.model.ExpressionDef> loadClassValueExpressionFn) - Parameters:
annotationMetadataWithDefaults
- The annotation metadata with defaultsdeclaringElement
- The declaring element nameowningType
- The owning typeargumentTypes
- The argument typesloadClassValueExpressionFn
- The load type method expression fn- Returns:
- The expression
-