diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-08-25 08:03:05 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-08-25 08:03:05 +0200 |
commit | bf24af1ed9808dc918dc81f0383103b6c51600a6 (patch) | |
tree | d899dae5a08c94b5184a558c16c9f743aee0c3c7 /src/de/animux/android/andmal/api/manga/MangaListParser.java | |
parent | 8a8dc0a2ac4f3552568d9e14bf5ae121394b055c (diff) | |
download | AndMAL-master.tar.gz AndMAL-master.tar.xz AndMAL-master.zip |
refactoring, mangalist, settings (current problem: refresh other list after changing the settings)HEADmaster
Diffstat (limited to '')
-rw-r--r-- | src/de/animux/android/andmal/api/manga/MangaListParser.java | 50 |
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)); + } + } +} |