What's the difference between JAXB annotations put on getter versus setters versus members?
问题 Title says it all. I would like to know what is the principial difference between putting JAXB annotation (like @XmlElement ) on field / getter / setter. It seems to me that (in simple cases) it does not matter. E.g. lets take this class A { private String a; public String getA() { return a; } public void setA(String a) { this.a = a; } } now it seems to me that it does not matter if I put @XmlElement on member field or on getter / setter. It just marshalls ok. Are there any usecases when I