Skip to content

io microsphere annotation processor ConfigurationPropertyAnnotationProcessor

github-actions[bot] edited this page Mar 21, 2026 · 1 revision

ConfigurationPropertyAnnotationProcessor

Type: Class | Module: microsphere-annotation-processor | Package: io.microsphere.annotation.processor | Since: 1.0.0

Source: microsphere-annotation-processor/src/main/java/io/microsphere/annotation/processor/ConfigurationPropertyAnnotationProcessor.java

Overview

The Processor for the ConfigurationProperty annotation

This class processes the ConfigurationProperty annotations during the compilation phase, collects metadata about annotated elements, and generates a JSON metadata file that contains configuration property information.

- `#init(ProcessingEnvironment)` initializes required utilities such as the Messager and ResourceProcessor.
- `#process(Set, RoundEnvironment)` handles each processing round:
    
        - During normal rounds, it resolves metadata from annotated elements.
        - On the final round, it writes collected metadata into a resource file.
    

- `#resolveMetadata(RoundEnvironment)` traverses all root elements to extract configuration property metadata.
- `#writeMetadata()` writes the generated metadata into a JSON file under
    `ResourceConstants#CONFIGURATION_PROPERTY_METADATA_RESOURCE` using a writer.

Declaration

public class ConfigurationPropertyAnnotationProcessor extends AbstractProcessor

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.1.10-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-annotation-processor</artifactId>
    <version>${microsphere-java.version}</version>
</dependency>

Tip: Use the BOM (microsphere-java-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.annotation.processor.ConfigurationPropertyAnnotationProcessor;

API Reference

Public Methods

Method Description
init
process
getSupportedSourceVersion

See Also

  • ConfigurationProperty
  • ConfigurationPropertyJSONElementVisitor
  • ConfigurationPropertyGenerator
  • ResourceProcessor
  • Messager
  • ProcessingEnvironment

This documentation was auto-generated from the source code of microsphere-java.

Home

java-annotations

java-core

jdk-tools

lang-model

annotation-processor

java-test

Clone this wiki locally