summaryrefslogblamecommitdiffstats
path: root/src/de/animux/android/andmal/api/manga/MangaListParser.java
blob: 7e0ec4b851aeac492140754e0685e104e76edb0d (plain) (tree)

















































                                                                                     
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));
		}	
	}
}