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 { private Anime currentAnime; public AnimeListParser(MalObjectStore 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)); } } }