01: package example.data;
02:
03: import java.util.*;
04: import javax.xml.bind.annotation.*;
05:
06: @XmlRootElement(name="photos")
07: public class FlickrPhotos implements FlickrPayload {
08: @XmlAttribute
09: public int page;
10: @XmlAttribute
11: public int pages;
12: @XmlAttribute
13: public int perpage;
14: @XmlAttribute
15: public int total;
16:
17: @XmlElement(name="photo")
18: public List<Photo> photos = new ArrayList<Photo>();
19:
20: public static class Photo {
21: @XmlAttribute
22: public String id;
23: @XmlAttribute
24: public String owner;
25: @XmlAttribute
26: public String secret;
27: @XmlAttribute
28: public int server;
29: @XmlAttribute
30: public String title;
31: @XmlAttribute
32: public int ispublic;
33: @XmlAttribute
34: public int isfriend;
35: @XmlAttribute
36: public int isfamily;
37:
38: public String toString() {
39: return "Photo[id=" + id + ", " + "owner=" + owner + ", "
40: + "secret=" + secret + ", " + "server=" + server
41: + ", " + "title=" + title + ", " + "ispublic="
42: + ispublic + ", " + "isfriend =" + isfriend + ", "
43: + "isfamily=" + isfamily + "]";
44: }
45: }
46:
47: public String toString() {
48: StringBuilder sb = new StringBuilder();
49: sb.append("FlickrPhotos[page=" + page + ", ");
50: sb.append("pages=" + pages + ", ");
51: sb.append("perpage=" + perpage + ", ");
52: sb.append("total=" + total + ", ");
53: sb.append("photos=(");
54:
55: for (Photo photo : photos) {
56: sb.append(photo.toString());
57: sb.append(' ');
58: }
59:
60: sb.append(")]");
61:
62: return sb.toString();
63: }
64: }
|