summaryrefslogtreecommitdiffstats
path: root/src/de/animux/android/andmal/api/manga/MangaListParser.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/de/animux/android/andmal/api/manga/MangaListParser.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/de/animux/android/andmal/api/manga/MangaListParser.java b/src/de/animux/android/andmal/api/manga/MangaListParser.java
new file mode 100644
index 0000000..7e0ec4b
--- /dev/null
+++ b/src/de/animux/android/andmal/api/manga/MangaListParser.java
@@ -0,0 +1,50 @@
+package de.animux.android.andmal.api.manga;
+
+import de.animux.android.andmal.api.MalListParser;
+import de.animux.android.andmal.api.MalObjectStore;
+
+public class MangaListParser extends MalListParser<Manga> {
+
+ private Manga currentManga;
+
+ public MangaListParser(MalObjectStore<Manga> objectStore) {
+ super(objectStore);
+ currentManga = new Manga();
+ }
+
+ @Override
+ public void addElement(String name, String value) {
+ if (name.equals("manga")) {
+ objectStore.add(currentManga);
+ currentManga = new Manga();
+ } else if (name.equals("series_mangadb_id")) {
+ currentManga.setId(Integer.valueOf(value));
+ } else if (name.equals("series_title")) {
+ currentManga.setTitle(value);
+ } else if (name.equals("series_synonyms")) {
+ currentManga.setSynonyms(value);
+ } else if (name.equals("series_type")) {
+ currentManga.setType(Integer.valueOf(value));
+ } else if (name.equals("series_chapters")) {
+ currentManga.setChapters(Integer.valueOf(value));
+ } else if (name.equals("volumes")) {
+ currentManga.setVolumes(Integer.valueOf(value));
+ } else if (name.equals("series_status")) {
+ currentManga.setStatus(Integer.valueOf(value));
+ } else if (name.equals("series_start")) {
+ currentManga.setStart(value);
+ } else if (name.equals("series_end")) {
+ currentManga.setEnd(value);
+ } else if (name.equals("series_image")) {
+ currentManga.setImage(value);
+ } else if (name.equals("my_id")) {
+ currentManga.setPersonalId(Integer.valueOf(value));
+ } else if (name.equals("my_read_chapters")) {
+ currentManga.setPersonalReadChapters(Integer.valueOf(value));
+ } else if (name.equals("my_read_volumes")) {
+ currentManga.setPersonalReadVolumes(Integer.valueOf(value));
+ } else if (name.equals("my_status")) {
+ currentManga.setPersonalStatus(Integer.valueOf(value));
+ }
+ }
+}