KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > data > FlickrPhotos


1 package example.data;
2
3 import java.util.*;
4 import javax.xml.bind.annotation.*;
5
6 @XmlRootElement(name="photos")
7 public class FlickrPhotos implements FlickrPayload {
8   @XmlAttribute public int page;
9   @XmlAttribute public int pages;
10   @XmlAttribute public int perpage;
11   @XmlAttribute public int total;
12
13   @XmlElement(name="photo") public List<Photo> photos = new ArrayList<Photo>();
14
15   public static class Photo {
16     @XmlAttribute public String JavaDoc id;
17     @XmlAttribute public String JavaDoc owner;
18     @XmlAttribute public String JavaDoc secret;
19     @XmlAttribute public int server;
20     @XmlAttribute public String JavaDoc title;
21     @XmlAttribute public int ispublic;
22     @XmlAttribute public int isfriend;
23     @XmlAttribute public int isfamily;
24
25     public String JavaDoc toString()
26     {
27       return "Photo[id=" + id + ", " +
28                    "owner=" + owner + ", " +
29                    "secret=" + secret + ", " +
30                    "server=" + server + ", " +
31                    "title=" + title + ", " +
32                    "ispublic=" + ispublic + ", " +
33                    "isfriend =" + isfriend + ", " +
34                    "isfamily=" + isfamily + "]";
35     }
36   }
37
38   public String JavaDoc toString()
39   {
40     StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
41     sb.append("FlickrPhotos[page=" + page + ", ");
42     sb.append( "pages=" + pages + ", ");
43     sb.append( "perpage=" + perpage + ", ");
44     sb.append( "total=" + total + ", ");
45     sb.append( "photos=(");
46
47     for (Photo photo : photos) {
48       sb.append(photo.toString());
49       sb.append(' ');
50     }
51
52     sb.append(")]");
53
54     return sb.toString();
55   }
56 }
57
Popular Tags