1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.tika.parser.mp3;
18
19
20
21
22
23 public class CompositeTagHandler implements ID3Tags {
24
25 private ID3Tags[] tags;
26
27 public CompositeTagHandler(ID3Tags[] tags) {
28 this.tags = tags;
29 }
30
31 public boolean getTagsPresent() {
32 for (ID3Tags tag : tags) {
33 if (tag.getTagsPresent()) {
34 return true;
35 }
36 }
37 return false;
38 }
39
40 public String getTitle() {
41 for (ID3Tags tag : tags) {
42 if (tag.getTitle() != null) {
43 return tag.getTitle();
44 }
45 }
46 return null;
47 }
48
49 public String getArtist() {
50 for (ID3Tags tag : tags) {
51 if (tag.getArtist() != null) {
52 return tag.getArtist();
53 }
54 }
55 return null;
56 }
57
58 public String getAlbum() {
59 for (ID3Tags tag : tags) {
60 if (tag.getAlbum() != null) {
61 return tag.getAlbum();
62 }
63 }
64 return null;
65 }
66
67 public String getYear() {
68 for (ID3Tags tag : tags) {
69 if (tag.getYear() != null) {
70 return tag.getYear();
71 }
72 }
73 return null;
74 }
75
76 public String getComment() {
77 for (ID3Tags tag : tags) {
78 if (tag.getComment() != null) {
79 return tag.getComment();
80 }
81 }
82 return null;
83 }
84
85 public String getGenre() {
86 for (ID3Tags tag : tags) {
87 if (tag.getGenre() != null) {
88 return tag.getGenre();
89 }
90 }
91 return null;
92 }
93
94 public String getTrackNumber() {
95 for (ID3Tags tag : tags) {
96 if (tag.getTrackNumber() != null) {
97 return tag.getTrackNumber();
98 }
99 }
100 return null;
101 }
102
103 }