diff options
Diffstat (limited to '')
-rw-r--r-- | src/de/animux/android/andmal/api/anime/AnimeListParser.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/de/animux/android/andmal/api/anime/AnimeListParser.java b/src/de/animux/android/andmal/api/anime/AnimeListParser.java new file mode 100644 index 0000000..e7545dd --- /dev/null +++ b/src/de/animux/android/andmal/api/anime/AnimeListParser.java @@ -0,0 +1,45 @@ +package de.animux.android.andmal.api.anime; + +import de.animux.android.andmal.api.MalListParser; +import de.animux.android.andmal.api.MalObjectStore; + +public class AnimeListParser extends MalListParser<Anime> { + + private Anime currentAnime; + + public AnimeListParser(MalObjectStore<Anime> objectStore) { + super(objectStore); + currentAnime = new Anime(); + } + + public void addElement(String name, String value) { + if (name.equals("anime")) { + objectStore.add(currentAnime); + currentAnime = new Anime(); + } else if (name.equals("series_animedb_id")) { + currentAnime.setId(Integer.valueOf(value)); + } else if (name.equals("series_title")) { + currentAnime.setTitle(value); + } else if (name.equals("series_synonyms")) { + currentAnime.setSynonyms(value); + } else if (name.equals("series_type")) { + currentAnime.setType(Integer.valueOf(value)); + } else if (name.equals("series_episodes")) { + currentAnime.setEpisodes(Integer.valueOf(value)); + } else if (name.equals("series_status")) { + currentAnime.setStatus(Integer.valueOf(value)); + } else if (name.equals("series_start")) { + currentAnime.setStart(value); + } else if (name.equals("series_end")) { + currentAnime.setEnd(value); + } else if (name.equals("series_image")) { + currentAnime.setImage(value); + } else if (name.equals("my_id")) { + currentAnime.setMyId(Integer.valueOf(value)); + } else if (name.equals("my_watched_episodes")) { + currentAnime.setWatchedEpisodes(Integer.valueOf(value)); + } else if (name.equals("my_status")) { + currentAnime.setMyStatus(Integer.valueOf(value)); + } + } +} |