2

Does anyone know if I'm able to take full JSON string, from below objects during custom serialization or deserialization:

  • JsonParser jp
  • DeserializationContext ctxt
  • SeserializationContext ctxt

I'm using JACKSON on rest API.

Object source = jsonParser.getCurrentLocation.getSourceRef();

Unfortunately I'm not able to take the JSON as string because this method is giving back an object which is: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.UnCloseableInputStream

PDS
  • 562
  • 3
  • 13
  • 27

1 Answers1

2
Object source = jsonParser.getCurrentLocation.getSourceRef();

It holds a reference to the original resource being read, if one available. See the documentation.

cassiomolin
  • 124,154
  • 35
  • 280
  • 359
  • unfortunatelly I'm not able to take the JSON as string because this method is giving back an object which is: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.UnCloseableInputStream – PDS May 17 '18 at 15:03
  • @PDS Why do you need that, by the way? – cassiomolin May 17 '18 at 15:07
  • I have a custom deserializer and I need inside of it, deserialize JSON using custom or default deserialization, according this I need JSON source – PDS May 17 '18 at 15:11