Skip to content

Instantly share code, notes, and snippets.

@SojiroNishimura
Created April 17, 2016 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SojiroNishimura/27c29fa93a531c9de79967232e273a49 to your computer and use it in GitHub Desktop.
Save SojiroNishimura/27c29fa93a531c9de79967232e273a49 to your computer and use it in GitHub Desktop.
はてぶホッテントリRSSのPOJO Classes
@Root(strict = false)
public class Channel {
private static final String TAG = Channel.class.getSimpleName();
@Attribute(name = "about", required = false)
@Namespace(reference = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
private String mAbout;
@Element(name = "title")
private String mTitle;
@Element(name = "link")
private String mLink;
@Element(name = "description")
private String mChannelDescription;
// 略
}
@Root(strict = false)
public class Item {
private static final String TAG = Item.class.getSimpleName();
@Attribute(name = "about", required = false)
@Namespace(reference = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
private String mAbout;
@Element(name = "title")
private String mTitle;
@Element(name = "link")
private String mLink;
@Element(name = "description")
private String mDescription;
@Element(name = "date")
@Namespace(reference = "http://purl.org/dc/elements/1.1/")
private String mDate;
@Element(name = "subject")
@Namespace(reference = "http://purl.org/dc/elements/1.1/")
private String mSubject;
@Element(name = "bookmarkcount")
@Namespace(reference = "http://www.hatena.ne.jp/info/xmlns#")
private int mBookmarkCount;
// 略
}
@NamespaceList({
@Namespace(reference = "http://purl.org/rss/1.0/"),
@Namespace(reference = "http://www.w3.org/1999/02/22-rdf-syntax-ns#", prefix = "rdf"),
@Namespace(reference = "http://purl.org/dc/elements/1.1/", prefix = "dc"),
@Namespace(reference = "http://www.hatena.ne.jp/info/xmlns#", prefix = "hatena")
})
@Namespace(reference = "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
@Root(strict = false)
public class Rdf {
private static final String TAG = Rdf.class.getSimpleName();
@Element(name = "channel")
private Channel mChannel;
@ElementList(inline = true)
private List<Item> mItemList;
// 略
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment