use of org.crosswire.jsword.book.basic.AbstractPassageBook in project step by STEPBible.
the class JSwordMetadataServiceImpl method getFirstChapterReference.
@Override
public String getFirstChapterReference(final String version) {
final Book bookFromVersion = versificationService.getBookFromVersion(version);
if (bookFromVersion instanceof AbstractPassageBook) {
final Iterator<BibleBook> bookIterator = ((AbstractPassageBook) bookFromVersion).getBibleBooks().iterator();
BibleBook bibleBook = bookIterator.next();
if (BibleBook.INTRO_BIBLE.equals(bibleBook) || BibleBook.INTRO_OT.equals(bibleBook) || BibleBook.INTRO_NT.equals(bibleBook)) {
bibleBook = bookIterator.next();
if (BibleBook.INTRO_OT.equals(bibleBook) || BibleBook.INTRO_NT.equals(bibleBook)) {
bibleBook = bookIterator.next();
}
}
return String.format("%s.%d", bibleBook.getOSIS(), 1);
}
throw new StepInternalException("Unable to ascertain first chapter of book.");
}
Aggregations