use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class MusicBrainzWebClient method lookupTags.
@Override
public LinkedList<Tag> lookupTags(Entity type, String mbid) throws IOException {
HttpEntity entity = get(QueryBuilder.tagLookup(type, mbid));
LinkedList<Tag> tags = responseParser.parseTagLookup(entity.getContent());
entity.consumeContent();
Collections.sort(tags);
return tags;
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class ArtistLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("artist") && !inArtistRelations) {
artist.setMbid(atts.getValue("id"));
artist.setType(atts.getValue("type"));
} 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("rating")) {
artist.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("country")) {
buildString();
} else if (localName.equals("relation") && inUrlRelations) {
buildString();
link = new WebLink();
link.setType(atts.getValue("type"));
} else if (localName.equals("target")) {
buildString();
} else if (localName.equals("life-span")) {
inLifeSpan = true;
} else if (localName.equals("begin")) {
buildString();
} else if (localName.equals("end")) {
buildString();
} else if (localName.equals("relation-list")) {
setRelationStatus(atts.getValue("target-type"));
} else if (inUnsupported(localName)) {
inUnsupported = true;
}
}
use of org.musicbrainz.android.api.data.Tag in project musicbrainz-android by jdamcd.
the class LabelLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("label")) {
label.setMbid(atts.getValue("id"));
} else if (localName.equals("name") && !inTag) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("rating")) {
label.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("country")) {
buildString();
} else if (localName.equals("begin")) {
buildString();
} else if (localName.equals("end")) {
buildString();
} else if (localName.equals("relation-list")) {
if (atts.getValue("target-type").equals("url")) {
inUrlRelations = true;
}
} else if (localName.equals("relation") && inUrlRelations) {
buildString();
link = new WebLink();
link.setType(atts.getValue("type"));
}
}
Aggregations