Skip to content

Commit

Permalink
🌟 更新 Codec 注解及其处理器
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Sep 10, 2024
1 parent fdf43bb commit 8ed146f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.tools.Diagnostic;
import java.util.Set;

Expand All @@ -25,10 +26,11 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
@Override
public boolean process(Set<? extends TypeElement> annotations, @NotNull RoundEnvironment roundEnv) {
for (Element element : roundEnv.getElementsAnnotatedWith(Codec.class)) {
TypeElement typeElem = (TypeElement) element;
String typeName = typeElem.getQualifiedName().toString();
Filer filer = processingEnv.getFiler();
log("Found @Codec annotation on " + typeName);
if (element instanceof VariableElement varElement) {
String typeName = varElement.getSimpleName().toString();
Filer filer = processingEnv.getFiler();
log("Found @Codec annotation on " + typeName);
}
}
return true;
}
Expand Down

0 comments on commit 8ed146f

Please sign in to comment.