use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class TagLookupTest method parseTags.
private LinkedList<Tag> parseTags(String xmlFile) throws IOException {
InputStream stream = getFileStream(xmlFile);
assertNotNull(stream);
LinkedList<Tag> tags = new ResponseParser().parseTagLookup(stream);
stream.close();
return tags;
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class ReleaseGroupLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("release-group")) {
releaseGroup.setMbid(atts.getValue("id"));
releaseGroup.setType(atts.getValue("type"));
} else if (localName.equals("title")) {
buildString();
} else if (localName.equals("first-release-date")) {
buildString();
} else if (localName.equals("artist")) {
artist = new ReleaseArtist();
artist.setMbid(atts.getValue("id"));
inArtist = true;
} else if (localName.equals("rating")) {
releaseGroup.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("name")) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("relation")) {
link = new WebLink();
link.setType(atts.getValue("type"));
} else if (localName.equals("target")) {
buildString();
}
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class TagHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("tag")) {
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
}
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class RecordingLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("recording")) {
recording.setMbid(atts.getValue("id"));
} else if (localName.equals("title")) {
buildString();
} else if (localName.equals("length")) {
buildString();
} else if (localName.equals("artist")) {
inArtist = true;
artist = new ReleaseArtist();
artist.setMbid(atts.getValue("id"));
} else if (localName.equals("name")) {
buildString();
} else if (localName.equals("tag-list")) {
inTags = true;
} else if (localName.equals("tag") && !inArtist) {
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("rating")) {
recording.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
}
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class ReleaseLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("release")) {
release.setReleaseMbid(atts.getValue("id"));
} else if (localName.equals("title")) {
buildString();
} else if (localName.equals("status")) {
buildString();
} else if (localName.equals("barcode")) {
buildString();
} else if (localName.equals("asin")) {
buildString();
} else if (localName.equals("artist")) {
inArtist = true;
releaseArtist = new ReleaseArtist();
releaseArtist.setMbid(atts.getValue("id"));
} else if (localName.equals("name")) {
buildString();
} else if (localName.equals("date")) {
buildString();
} else if (localName.equals("label")) {
inLabel = true;
} else if (localName.equals("release-group")) {
inReleaseGroup = true;
release.setReleaseGroupMbid(atts.getValue("id"));
} else if (localName.equals("track")) {
inTrack = true;
track = new Track();
} else if (localName.equals("recording")) {
inRecording = true;
track.setRecordingMbid(atts.getValue("id"));
} else if (localName.equals("position")) {
buildString();
} else if (localName.equals("length")) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("rating") && inReleaseGroup) {
release.setReleaseGroupRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("relation-list")) {
inRelationships = true;
} else if (localName.equals("medium")) {
inMedium = true;
}
}
Aggregations