Class ArgumentExpUtils

java.lang.Object
io.micronaut.inject.writer.ArgumentExpUtils

@Internal public final class ArgumentExpUtils extends Object
The argument expression utils.
Since:
4.8
Author:
Denis Stepanov
  • 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

      public static final Method 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 defaults
      owningType - The owning type
      declaringType - The declaring type name
      argument - The argument
      loadClassValueExpressionFn - 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 defaults
      declaringType - The declaring type name
      owningType - The owning type
      argumentName - The argument name
      argument - The argument
      loadClassValueExpressionFn - 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 generics
      annotationMetadata - The annotation metadata reference
      generics - 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 defaults
      declaringElement - The declaring element name
      owningType - The owning type
      argumentTypes - The argument types
      loadClassValueExpressionFn - The load type method expression fn
      Returns:
      The expression