Search in sources :

Example 1 with ReleaseArtist

use of org.musicbrainz.android.api.data.ReleaseArtist in project musicbrainz-android by jdamcd.

the class RecordingSearchHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("recording")) {
        recording = new RecordingInfo();
        recording.setMbid(atts.getValue("id"));
    } else if (localName.equals("title") && !inReleaseList) {
        buildString();
    } else if (localName.equals("artist")) {
        inArtist = true;
        recordingArtist = new ReleaseArtist();
        recordingArtist.setMbid(atts.getValue("id"));
    } else if (localName.equals("name") && inArtist) {
        buildString();
    } else if (localName.equals("length")) {
        buildString();
    } else if (localName.equals("release-list")) {
        inReleaseList = true;
    }
}
Also used : RecordingInfo(org.musicbrainz.android.api.data.RecordingInfo) ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist)

Example 2 with ReleaseArtist

use of org.musicbrainz.android.api.data.ReleaseArtist 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();
    }
}
Also used : ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist) Tag(org.musicbrainz.android.api.data.Tag) WebLink(org.musicbrainz.android.api.data.WebLink)

Example 3 with ReleaseArtist

use of org.musicbrainz.android.api.data.ReleaseArtist in project musicbrainz-android by jdamcd.

the class ReleaseGroupSearchHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("release-group")) {
        rg = new ReleaseGroupInfo();
        rg.setMbid(atts.getValue("id"));
        rg.setType(atts.getValue("type"));
    } else if (localName.equals("title")) {
        buildString();
    } else if (localName.equals("artist")) {
        inArtist = true;
        releaseArtist = new ReleaseArtist();
        releaseArtist.setMbid(atts.getValue("id"));
    } else if (localName.equals("name") && inArtist) {
        buildString();
    } else if (localName.equals("release")) {
        rg.addReleaseMbid(atts.getValue("id"));
    }
}
Also used : ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist) ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo)

Example 4 with ReleaseArtist

use of org.musicbrainz.android.api.data.ReleaseArtist in project musicbrainz-android by jdamcd.

the class ReleaseInfoHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("release")) {
        release = new ReleaseInfo();
        release.setReleaseMbid(atts.getValue("id"));
    } else if (localName.equals("title")) {
        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("country")) {
        buildString();
    } else if (localName.equals("track-list")) {
        String num = atts.getValue("count");
        int tracks = Integer.parseInt(num);
        release.setTracksNum(release.getTracksNum() + tracks);
    } else if (localName.equals("label")) {
        inLabel = true;
    } else if (localName.equals("format")) {
        buildString();
    } else if (localName.equals("medium")) {
        inMedium = true;
    } else if (localName.equals("sort-name")) {
        buildString();
    }
}
Also used : ReleaseInfo(org.musicbrainz.android.api.data.ReleaseInfo) ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist)

Example 5 with ReleaseArtist

use of org.musicbrainz.android.api.data.ReleaseArtist in project musicbrainz-android by jdamcd.

the class CollectionHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("collection")) {
        collection.setMbid(atts.getValue("id"));
    } else if (localName.equals("name")) {
        buildString();
    } else if (localName.equals("editor")) {
        buildString();
    } else if (localName.equals("release-list")) {
        collection.setCount(Integer.parseInt(atts.getValue("count")));
    } else if (localName.equals("release")) {
        release = new ReleaseInfo();
        release.setReleaseMbid(atts.getValue("id"));
    } else if (localName.equals("title")) {
        buildString();
    } else if (localName.equals("date")) {
        buildString();
    } else if (localName.equals("country")) {
        buildString();
    } else if (localName.equals("artist")) {
        inArtist = true;
        releaseArtist = new ReleaseArtist();
        releaseArtist.setMbid(atts.getValue("id"));
    } else if (localName.equals("sort-name")) {
        buildString();
    }
}
Also used : ReleaseInfo(org.musicbrainz.android.api.data.ReleaseInfo) ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist)

Aggregations

ReleaseArtist (org.musicbrainz.android.api.data.ReleaseArtist)14 Test (org.junit.Test)7 ReleaseInfo (org.musicbrainz.android.api.data.ReleaseInfo)5 Tag (org.musicbrainz.android.api.data.Tag)3 RecordingInfo (org.musicbrainz.android.api.data.RecordingInfo)2 ReleaseGroupInfo (org.musicbrainz.android.api.data.ReleaseGroupInfo)1 Track (org.musicbrainz.android.api.data.Track)1 WebLink (org.musicbrainz.android.api.data.WebLink)1