int cardinality = key.getCardinality();
String localBookName = null;
for (int i = 0; i < cardinality; i++) {
Key k = key.get(i);
Verse v = KeyUtil.getVerse(k);
if (localBookName == null) {
int bookNum = v.getBook();
try {
localBookName = BibleInfo.getPreferredBookName(bookNum);
} catch (NoSuchVerseException ex) {
Logger.getLogger(BibleVerseListPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
BookData data = new BookData(swordBook, k);
try {
//The following line can throw a BookException
Element xmlData = data.getOsis();
fullTxt = OSISUtil.getCanonicalText(xmlData);
if (sb.length() > 0) {
sb.append(splitType.getTxt());
}
switch (refStype) {
case Full:
sb.append(localBookName).append(" ").append(v.getChapter()).append(":").append(v.getVerse()).append(" ");
break;
case ChapterAndVerse:
sb.append(v.getChapter()).append(":").append(v.getVerse()).append(" ");
break;
case VerseOnly:
sb.append(v.getVerse()).append(" ");
break;
}
sb.append(fullTxt).append(endl);