The only way I found was to register a DeserializationProblemHandler and return null on instantiation problem. This isn't great because I have to handle null values in my Collections, but it's better than nothing
On Tuesday, July 19, 2016 at 8:39:26 PM UTC-7, Nathan Barraille wrote: > > Hello, > I'm using Jackson to deserialize network responses containing arrays of > custom objects. > I use a Builder to instantiate those objects, which is in charge of making > sure that the object is valid (required fieds are present, etc..) and > throws an IllegalStateException when trying to build an invalid object. > > When I deserialize arrays of these objects, I would like to be able to > ignore invalid ones, and still return an array containing the valid ones, > instead of dropping all of them. > Ideally, I would like to have a callback or some kind of error handler so > that I can do custom logging when that happens too. > > Here is a short code example: > https://gist.github.com/nbarraille/6804fe0d69ddfd3be22399d3b1727c4a > > How can I do this? > Thanks! > Nahtan > > > -- 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 post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
