@JsonSerialize and @JsonDeserialize not working when included in an annotation
问题 I am trying to create a custom annotation to tokenize a given property always when it is annotated with, so I have the following structure: @JsonComponent public class TokenSerializer { @JsonSerialize(using = IdToTokenSerializer.class) // This does not work @JsonDeserialize(using = TokenToIdDeserializer.class) // This does not work @Retention(RetentionPolicy.RUNTIME) public static @interface TokenizedId { Class<?> value(); } public static class IdToTokenSerializer extends JsonSerializer<Long>