Fix StAX parser
This commit is contained in:
parent
b00913cb2f
commit
c35879a65f
@ -1 +1,2 @@
|
||||
/.DS_Store
|
||||
/fr/
|
||||
|
@ -13,27 +13,27 @@ public class Album {
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
|
||||
private String cover;
|
||||
|
||||
|
||||
private List<Track> tracks = new ArrayList<Track>();
|
||||
|
||||
public Album() {
|
||||
public Album() {
|
||||
}
|
||||
|
||||
|
||||
public void addTrack(Track title) {
|
||||
tracks.add(title);
|
||||
}
|
||||
|
||||
|
||||
public List<Track> getTracks() {
|
||||
return tracks;
|
||||
}
|
||||
|
||||
public void setTracks(List<Track> tracks) {
|
||||
this.tracks = tracks;
|
||||
}
|
||||
this.tracks = tracks;
|
||||
}
|
||||
|
||||
public Artist getArtist() {
|
||||
public Artist getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
@ -42,14 +42,14 @@ public class Album {
|
||||
}
|
||||
|
||||
public String getCover() {
|
||||
return cover;
|
||||
}
|
||||
return cover;
|
||||
}
|
||||
|
||||
public void setCover(String cover) {
|
||||
this.cover = cover;
|
||||
}
|
||||
public void setCover(String cover) {
|
||||
this.cover = cover;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -64,5 +64,5 @@ public class Album {
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -95,8 +95,14 @@ public class StAXSearchAlbums extends AbstractSearchAlbum {
|
||||
switch(element)
|
||||
{
|
||||
case "id":
|
||||
if(isArtist) buildingArtist.setId(reader.getText());
|
||||
else buildingAlbum.setId(reader.getText());
|
||||
if(isArtist)
|
||||
{
|
||||
buildingArtist.setId(reader.getText());
|
||||
}
|
||||
else
|
||||
{
|
||||
buildingAlbum.setId(reader.getText());
|
||||
}
|
||||
break;
|
||||
case "title":
|
||||
buildingAlbum.setTitle(reader.getText());
|
||||
@ -125,6 +131,8 @@ public class StAXSearchAlbums extends AbstractSearchAlbum {
|
||||
buildingAlbum.setArtist(buildingArtist);
|
||||
isArtist = false;
|
||||
break;
|
||||
default:
|
||||
element = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
12:30:47,649 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - >>testCount
|
||||
12:30:47,657 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - >>count
|
||||
12:30:47,677 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - <<count 10
|
||||
12:30:47,677 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - <<testCount
|
||||
12:30:47,677 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - >>testParse
|
||||
12:30:47,681 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - >>readAlbums
|
||||
12:30:47,689 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - <<readAlbums
|
||||
16:23:10,446 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - >>testCount
|
||||
16:23:10,449 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - >>count
|
||||
16:23:10,460 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - <<count 10
|
||||
16:23:10,461 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - <<testCount
|
||||
16:23:10,462 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - >>testParse
|
||||
16:23:10,462 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - >>readAlbums
|
||||
16:23:10,467 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbums - <<readAlbums
|
||||
16:23:10,468 DEBUG fr.ensim.xml.deezer.stax.StAXSearchAlbumsTest - <<testParse
|
||||
|
Loading…
Reference in New Issue
Block a user