Skip to content

io microsphere metadata ConfigurationPropertyGenerator

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

ConfigurationPropertyGenerator

Type: Interface | Module: microsphere-java-core | Package: io.microsphere.metadata | Since: 1.0.0

Source: microsphere-java-core/src/main/java/io/microsphere/metadata/ConfigurationPropertyGenerator.java

Overview

ConfigurationPropertyGenerator interface can be implemented by objects that generate string representations (e.g., JSON, XML, Properties) of ConfigurationProperty.

Implementing classes should typically also implement the Prioritized#getPriority() method to define their priority value. The priority is used to determine ordering via the Prioritized#compareTo(Prioritized) method.

Example Usage

`public class JsonPropertyGenerator implements ConfigurationPropertyGenerator {
    public int getPriority() {
        return 1;
    `

    public String generate(ConfigurationProperty property) {
        // Implementation to generate JSON representation
        return "{\"" + property.getName() + "\":\"" + property.getValue() + "\"}";
    }
}

// Registering and using generators
List generators = new ArrayList<>();
generators.add(new JsonPropertyGenerator());
Collections.sort(generators); // Sort by priority
}

Declaration

public interface ConfigurationPropertyGenerator extends Prioritized

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

Examples

public class JsonPropertyGenerator implements ConfigurationPropertyGenerator {
    public int getPriority() {
        return 1;
    }

    public String generate(ConfigurationProperty property) {
        // Implementation to generate JSON representation
        return "{\"" + property.getName() + "\":\"" + property.getValue() + "\"}";
    }
}

// Registering and using generators
List<ConfigurationPropertyGenerator> generators = new ArrayList<>();
generators.add(new JsonPropertyGenerator());
Collections.sort(generators); // Sort by priority

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-java-core</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.metadata.ConfigurationPropertyGenerator;

See Also

  • ConfigurationProperty
  • Prioritized

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