Hello,
Is it possible to optionally serialize the properties of a class via JAX-B using using some dynamic flag?
e.g. Suppose I Have
@XmlRootElement
public class TodoItem {
private int id;
private String title;
private String note;
// getters, setters
}
and the following web service operatios:
public TodoItem getTodoItemFull(int id) { .... }
public TodoItem getTodoItemMinimal(int id) { .... }
Is there a special annotation I can use so that I can decide at runtime whether property "note" will be serialized? In other words, the getTodoItemFull() method will return the fully serialized class, while the getTodoItemMinimal() method will return that serialized class without the "note" xml element?
Thanks,!