Class ConfigurationMetadataBuilder

java.lang.Object
io.micronaut.inject.configuration.ConfigurationMetadataBuilder

public class ConfigurationMetadataBuilder extends Object

A builder for producing metadata for the available ConfigurationProperties.

This data can then be subsequently written to a format readable by IDEs (like spring-configuration-metadata.json for example).

Since:
1.0
Author:
Graeme Rocher, Denis Stepanov
  • Field Details

  • Constructor Details

    • ConfigurationMetadataBuilder

      public ConfigurationMetadataBuilder()
  • Method Details

    • getOriginatingElements

      @NonNull public Element[] getOriginatingElements()
      Returns:
      The originating elements for the builder.
    • getProperties

      public List<PropertyMetadata> getProperties()
      Returns:
      The properties
    • getConfigurations

      public List<ConfigurationMetadata> getConfigurations()
      Returns:
      The configurations
    • hasMetadata

      public boolean hasMetadata()
      Returns:
      Whether any metadata is present
    • visitProperties

      public ConfigurationMetadata visitProperties(ClassElement classElement)
      Parameters:
      classElement - The type of the ConfigurationProperties
      Returns:
      This ConfigurationMetadata
    • resolveJavadocDescription

      @Nullable public static String resolveJavadocDescription(@NonNull Element element)
      Resolves the javadoc description for the given element.
      Parameters:
      element - The element
      Returns:
      The javadoc description.
    • visitProperty

      public PropertyMetadata visitProperty(ClassElement owningType, ClassElement declaringType, ClassElement propertyType, String name, @Nullable String description, @Nullable String defaultValue)
      Visit a configuration property.
      Parameters:
      owningType - The type that owns the property
      declaringType - The declaring type of the property
      propertyType - The property type
      name - The property name
      description - A description for the property
      defaultValue - The default value of the property (only used for constant values such as strings, numbers, enums etc.)
      Returns:
      This property metadata
    • reset

      @Internal public static void reset()
      Reset the state.