Jeremy Chone
Jeremy Chone

Reputation: 3167

With Jackson is it possible to just ignore all cyclic relationship without having to add annotation?

Jackson 2.0 has pretty good support for cyclic reference, however, it seems that all require to annotate the POJO classes. What if I cannot edit the java classes I want to serialize to json, but want to just ignore cyclic reference like the json lib jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT) which basically ignore cyclic reference when one occurs.

Upvotes: 1

Views: 279

Answers (1)

StaxMan
StaxMan

Reputation: 116610

No. Jackson does not do full cycle detection; identity checks are only done when annotation indicates that they are needed.

Upvotes: 2

Related Questions