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 { private Manga currentManga; public MangaListParser(MalObjectStore 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)); } } }