Skip to content

Commit

Permalink
Adds processor to annotation JsonAutoDetector
Browse files Browse the repository at this point in the history
* Fixs imports
  • Loading branch information
netodevel committed Oct 14, 2021
1 parent 9896767 commit 3367a93
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.jboss.jandex.IndexView;
import org.jboss.jandex.Type;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.SimpleObjectIdResolver;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonSerializer;
Expand Down Expand Up @@ -55,6 +56,8 @@ public class JacksonProcessor {

private static final DotName JSON_SERIALIZE = DotName.createSimple(JsonSerialize.class.getName());

private static final DotName JSON_AUTO_DETECTOR = DotName.createSimple(JsonAutoDetect.class.getName());

private static final DotName JSON_CREATOR = DotName.createSimple("com.fasterxml.jackson.annotation.JsonCreator");

private static final DotName JSON_NAMING = DotName.createSimple("com.fasterxml.jackson.databind.annotation.JsonNaming");
Expand Down Expand Up @@ -168,6 +171,11 @@ void register(
}
}

for (AnnotationInstance creatorInstance : index.getAnnotations(JSON_AUTO_DETECTOR)) {
reflectiveClass
.produce(new ReflectiveClassBuildItem(true, true, creatorInstance.target().asClass().name().toString()));
}

// make sure we register the constructors and methods marked with @JsonCreator for reflection
for (AnnotationInstance creatorInstance : index.getAnnotations(JSON_CREATOR)) {
if (METHOD == creatorInstance.target().kind()) {
Expand Down

0 comments on commit 3367a93

Please sign in to comment.