Class ConfigurationMetadataBuilder
java.lang.Object
io.micronaut.inject.configuration.ConfigurationMetadataBuilder
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static void
reset()
Reset the state.resolveJavadocDescription
(@NonNull Element element) Resolves the javadoc description for the given element.visitProperties
(ClassElement classElement) Visit aConfigurationProperties
class.visitProperty
(ClassElement owningType, ClassElement declaringType, ClassElement propertyType, String name, @Nullable String description, @Nullable String defaultValue) Visit a configuration property.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ConfigurationMetadataBuilder
public ConfigurationMetadataBuilder()
-
-
Method Details
-
getOriginatingElements
- Returns:
- The originating elements for the builder.
-
getProperties
- Returns:
- The properties
-
getConfigurations
- Returns:
- The configurations
-
hasMetadata
public boolean hasMetadata()- Returns:
- Whether any metadata is present
-
visitProperties
Visit aConfigurationProperties
class.- Parameters:
classElement
- The type of theConfigurationProperties
- Returns:
- This
ConfigurationMetadata
-
resolveJavadocDescription
@Nullable public static @Nullable String resolveJavadocDescription(@NonNull @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 @Nullable String description, @Nullable @Nullable String defaultValue) Visit a configuration property.- Parameters:
owningType
- The type that owns the propertydeclaringType
- The declaring type of the propertypropertyType
- The property typename
- The property namedescription
- A description for the propertydefaultValue
- The default value of the property (only used for constant values such as strings, numbers, enums etc.)- Returns:
- This property metadata
-
reset
Reset the state.
-