Search in sources :

Example 1 with PropertyMetadata

use of io.micronaut.inject.configuration.PropertyMetadata in project micronaut-core by micronaut-projects.

the class BeanDefinitionWriter method processConfigurationConstructorParameter.

private void processConfigurationConstructorParameter(ParameterElement parameter, AnnotationMetadata annotationMetadata) {
    ClassElement parameterType = parameter.getGenericType();
    if (!parameterType.hasStereotype(AnnotationUtil.SCOPE)) {
        final PropertyMetadata pm = metadataBuilder.visitProperty(parameterType.getName(), parameter.getName(), parameter.getDocumentation().orElse(null), annotationMetadata.stringValue(Bindable.class, "defaultValue").orElse(null));
        parameter.annotate(Property.class, (builder) -> builder.member("name", pm.getPath()));
    }
}
Also used : PropertyMetadata(io.micronaut.inject.configuration.PropertyMetadata) ClassElement(io.micronaut.inject.ast.ClassElement)

Aggregations

ClassElement (io.micronaut.inject.ast.ClassElement)1 PropertyMetadata (io.micronaut.inject.configuration.PropertyMetadata)1