File tree Expand file tree Collapse file tree 7 files changed +118
-3
lines changed
sources/net.sf.j2s.java.core/src/test/jaxb Expand file tree Collapse file tree 7 files changed +118
-3
lines changed Original file line number Diff line number Diff line change 11package test .jaxb ;
22
3+ import javax .xml .bind .annotation .XmlAccessType ;
4+ import javax .xml .bind .annotation .XmlAccessorType ;
35import javax .xml .bind .annotation .XmlAttribute ;
46import javax .xml .bind .annotation .XmlRootElement ;
57
68// source: http://blog.bdoughan.com/2011/06/jaxb-and-complex-types-with-simple.html
9+ // note that we are not honoring package-info here. Why not?
710@ XmlRootElement (name ="phone-number" )
811public class PhoneNumber {
912
1013 private String type ;
1114 private String number ;
1215
13- @ XmlAttribute
14- public String getType () {
15- return type ;
16+ public String getType () {
17+ return type +"????" ;
1618 }
1719
1820 public void setType (String type ) {
Original file line number Diff line number Diff line change 1+ package test .jaxb .field ;
2+
3+ import javax .xml .bind .annotation .XmlAccessType ;
4+ import javax .xml .bind .annotation .XmlAccessorType ;
5+ import javax .xml .bind .annotation .XmlAttribute ;
6+ import javax .xml .bind .annotation .XmlRootElement ;
7+
8+ // source: http://blog.bdoughan.com/2011/06/jaxb-and-complex-types-with-simple.html
9+ // note that we are not honoring package-info here. Why not?
10+ @ XmlRootElement (name ="phone-number" )
11+ public class PhoneNumber {
12+
13+ private String type ;
14+ private String number ;
15+
16+ public String getType () {
17+ return type +"(property)" ;
18+ }
19+
20+ public void setType (String type ) {
21+ this .type = type ;
22+ }
23+
24+ public String getNumber () {
25+ return number +"(property)" ;
26+ }
27+
28+ public void setNumber (String number ) {
29+ this .number = number ;
30+ }
31+
32+ }
Original file line number Diff line number Diff line change 1+ @ javax .xml .bind .annotation .XmlSchema (namespace = "package-namespace" , elementFormDefault = javax .xml .bind .annotation .XmlNsForm .QUALIFIED )
2+ @ XmlAccessorType (XmlAccessType .FIELD )
3+ package test .jaxb .field ;
4+
5+ import javax .xml .bind .annotation .XmlAccessType ;
6+ import javax .xml .bind .annotation .XmlAccessorType ;
Original file line number Diff line number Diff line change 1+ package test .jaxb .property ;
2+
3+ import javax .xml .bind .annotation .XmlAccessType ;
4+ import javax .xml .bind .annotation .XmlAccessorType ;
5+ import javax .xml .bind .annotation .XmlAttribute ;
6+ import javax .xml .bind .annotation .XmlRootElement ;
7+
8+ // source: http://blog.bdoughan.com/2011/06/jaxb-and-complex-types-with-simple.html
9+ // note that we are not honoring package-info here. Why not?
10+ @ XmlRootElement (name ="phone-number" )
11+ public class PhoneNumber {
12+
13+ private String type ;
14+ public String number ;
15+
16+ public String getType () {
17+ return type +"(property)" ;
18+ }
19+
20+ public void setType (String type ) {
21+ this .type = type ;
22+ }
23+
24+ private String getNumber () {
25+ return number +"(property)" ;
26+ }
27+
28+ private void setNumber (String number ) {
29+ this .number = number ;
30+ }
31+
32+
33+ }
Original file line number Diff line number Diff line change 1+ @ javax .xml .bind .annotation .XmlSchema (namespace = "package-namespace" , elementFormDefault = javax .xml .bind .annotation .XmlNsForm .QUALIFIED )
2+ @ XmlAccessorType (XmlAccessType .PROPERTY )
3+ package test .jaxb .property ;
4+
5+ import javax .xml .bind .annotation .XmlAccessType ;
6+ import javax .xml .bind .annotation .XmlAccessorType ;
Original file line number Diff line number Diff line change 1+ package test .jaxb .publicmember ;
2+
3+ import javax .xml .bind .annotation .XmlRootElement ;
4+
5+ // source: http://blog.bdoughan.com/2011/06/jaxb-and-complex-types-with-simple.html
6+ // note that we are not honoring package-info here. Why not?
7+ @ XmlRootElement (name ="phone-number" )
8+ public class PhoneNumber {
9+
10+ private String type ;
11+ public String number ;
12+
13+ public String getType () {
14+ return type +"(property)" ;
15+ }
16+
17+ public void setType (String type ) {
18+ this .type = type ;
19+ }
20+
21+ String getNumber () {
22+ return number +"(property)" ;
23+ }
24+
25+ void setNumber (String number ) {
26+ this .number = number ;
27+ }
28+
29+
30+ }
Original file line number Diff line number Diff line change 1+ @ javax .xml .bind .annotation .XmlSchema (namespace = "package-namespace" , elementFormDefault = javax .xml .bind .annotation .XmlNsForm .QUALIFIED )
2+ @ XmlAccessorType (XmlAccessType .PUBLIC_MEMBER )
3+ package test .jaxb .publicmember ;
4+
5+ import javax .xml .bind .annotation .XmlAccessType ;
6+ import javax .xml .bind .annotation .XmlAccessorType ;
You can’t perform that action at this time.
0 commit comments