Class ConfigurationPropertyJSONElementVisitor
- java.lang.Object
-
- javax.lang.model.util.AbstractElementVisitor6<R,P>
-
- javax.lang.model.util.SimpleElementVisitor6<R,P>
-
- javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,java.lang.StringBuilder>
-
- io.microsphere.annotation.processor.model.util.JSONElementVisitor
-
- io.microsphere.annotation.processor.model.util.AnnotatedElementJSONElementVisitor
-
- io.microsphere.annotation.processor.model.util.ConfigurationPropertyJSONElementVisitor
-
- All Implemented Interfaces:
javax.lang.model.element.ElementVisitor<java.lang.Boolean,java.lang.StringBuilder>
public class ConfigurationPropertyJSONElementVisitor extends AnnotatedElementJSONElementVisitor
TheElementVisitor
forConfigurationProperty
JSON- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ConfigurationProperty
,ElementVisitor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANNOTATION_CLASS_NAME
-
Fields inherited from class io.microsphere.annotation.processor.model.util.AnnotatedElementJSONElementVisitor
annotationClassName, annotationType, annotationTypeElement, elements, elementTypes, processingEnv
-
-
Constructor Summary
Constructors Constructor Description ConfigurationPropertyJSONElementVisitor(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
visitVariableAsField(javax.lang.model.element.VariableElement field, java.lang.StringBuilder jsonBuilder)
Processes theVariableElement
annotated withConfigurationProperty
, converting its annotation values into a JSON structure within the providedStringBuilder
.-
Methods inherited from class io.microsphere.annotation.processor.model.util.AnnotatedElementJSONElementVisitor
getAnnotationClassName, supports
-
Methods inherited from class io.microsphere.annotation.processor.model.util.JSONElementVisitor
doVisitPackage, doVisitTypeParameter, supportsExecutable, supportsPackage, supportsType, supportsTypeParameter, supportsVariable, visitExecutable, visitMembers, visitPackage, visitType, visitTypeParameter, visitVariable
-
Methods inherited from class javax.lang.model.util.ElementKindVisitor6
visitExecutableAsConstructor, visitExecutableAsInstanceInit, visitExecutableAsMethod, visitExecutableAsStaticInit, visitTypeAsAnnotationType, visitTypeAsClass, visitTypeAsEnum, visitTypeAsInterface, visitVariableAsEnumConstant, visitVariableAsExceptionParameter, visitVariableAsLocalVariable, visitVariableAsParameter, visitVariableAsResourceVariable
-
-
-
-
Field Detail
-
ANNOTATION_CLASS_NAME
public static final java.lang.String ANNOTATION_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
visitVariableAsField
public java.lang.Boolean visitVariableAsField(javax.lang.model.element.VariableElement field, java.lang.StringBuilder jsonBuilder)
Processes theVariableElement
annotated withConfigurationProperty
, converting its annotation values into a JSON structure within the providedStringBuilder
.This method extracts the annotation attributes and appends them as key-value pairs in JSON format. If the "name" attribute is empty, it uses the variable's constant value as the name. Additionally, it appends metadata such as the source type and field name.
- Overrides:
visitVariableAsField
in classjavax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,java.lang.StringBuilder>
- Parameters:
field
- the variable element being visitedjsonBuilder
- the string builder used to accumulate JSON content- Returns:
- always returns
null
as no result needs to be propagated up the visitor chain
-
-