I don't know well, Post a question. 
I used Jackson Json Libraries with SpringBoot

When i use @JsonSerialize(using = CustomSerializer.class) in severals POJO 
class Field

CustomSerializer has no-args constructor with "initialized" logging command
Jackson create Serializer instance for Each POJO class on Json Serialize 
Process.

how can i create Serializer single instance, and share this.

is it right thinking?

  public class CustomSerializer extends JsonSerializer<String> {

        public CustomSerializer() {
            super();
            log.info("initialize : {}", this);
        }
    
        @Override
        public void serialize(String value, JsonGenerator gen, 
SerializerProvider serializers) throws IOException {
            gen.writeString("Custom-" + value);
        }

    }



    

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/bb31fa09-ed3d-42ab-a503-7c8cd8b12ff3o%40googlegroups.com.

Reply via email to