Skip to content

io microsphere lang model util JSONElementVisitor

github-actions[bot] edited this page Apr 11, 2026 · 5 revisions

JSONElementVisitor

Type: Class | Module: microsphere-lang-model | Package: io.microsphere.lang.model.util | Since: 1.0.0

Source: microsphere-lang-model/src/main/java/io/microsphere/lang/model/util/JSONElementVisitor.java

Overview

A specialized ElementVisitor implementation that traverses Java elements and generates JSON representations of the elements' metadata.

This abstract class extends ElementKindVisitor6 to provide a foundation for creating JSON-based representations of various Java language elements such as packages, types, methods, fields, and type parameters.

Example Usage

`public class CustomJSONElementVisitor extends JSONElementVisitor {
    // Implement specific visit methods to customize JSON generation
`
}

Subclasses should implement or override the appropriate visit methods to customize how different Java elements are represented in JSON.

Declaration

public abstract class JSONElementVisitor extends ElementKindVisitor6<Boolean, StringBuilder>

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.8-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 CustomJSONElementVisitor extends JSONElementVisitor {
    // Implement specific visit methods to customize JSON generation
}

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-lang-model</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.lang.model.util.JSONElementVisitor;

API Reference

Public Methods

Method Description
visitPackage
visitVariable
visitExecutable
visitType
visitTypeParameter

See Also

  • ElementVisitor
  • ElementKindVisitor6
  • AbstractElementVisitor6

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

Home

annotation-processor

java-annotations

java-core

java-test

jdk-tools

lang-model

Clone this wiki locally