Guest User

Untitled

a guest
Aug 10th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. default initialization value for jaxb generated class
  2. @XmlRootElement
  3. @XmlAccessorType(XmlAccessType.PROPERTY)
  4. public class foo {
  5. boolean bar = true;
  6.  
  7. boolean getBar () {
  8. return this.bar;
  9. }
  10.  
  11. void setBar (boolean bar) {
  12. this.bar = bar;
  13. }
  14. }
  15.  
  16. @XmlElement (defaultvalue="true")
  17. boolean getBar () {
  18. return this.bar;
  19. }
  20.  
  21. <xs:element default="true" name="bar" type="xs:boolean"/>
  22.  
  23. @XmlAccessorType(XmlAccessType.FIELD)
  24. public class foo {
  25. @XmlElement(defaultValue = "true")
  26. protected boolean bar;
  27.  
  28. boolean getBar () {
  29. return this.bar;
  30. }
  31.  
  32. void setBar (boolean bar) {
  33. this.bar = bar;
  34. }
  35. }
Add Comment
Please, Sign In to add comment