gilbertpilz
gilbertpilz

Reputation: 1806

Make YamlBeans ignore specific class members

I've been working with the Jackson libraries for serializing/deserializing from/to Java classes. A nifty feature of Jackson is the @JsonIgnore annotation. You use this annotation to indicate to the Jackson serialization code that it should ignore a specific method when introspecting an object. This allows you to add utility methods etc. to the classes that are either created from JSON input or are used to create JSON output without having the results of those utility methods show up in the JSON output.

I've been using YamlBeans 1.0.6 to do simple YAML parsing. I'm making some changes where something like "@YamlIgnore" would be handy. I've searched around and there doesn't seem to be any direct corollary to @JsonIgnore, but I'm wondering if there is some other way I can tell YamlBeans to ignore specific methods?

Upvotes: 2

Views: 453

Answers (1)

Gogu
Gogu

Reputation: 91

if it helps, I noticed that only the members that have a setter will be saved. Using Yamlbeans 1.0.8

Upvotes: 2

Related Questions