public class APIExamples extends Object
The GNU Lesser General Public License for details.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
APIExamples.MyBookFilter
A simple BookFilter that looks for a Bible by name.
|
(package private) static class |
APIExamples.MyBooksListener
A simple BooksListener that actually does nothing.
|
Modifier and Type | Field and Description |
---|---|
private static String |
BIBLE_NAME
The name of a Bible to find
|
Constructor and Description |
---|
APIExamples() |
Modifier and Type | Method and Description |
---|---|
Book |
getBook(String bookInitials)
Get a particular installed book by initials.
|
SAXEventProvider |
getOSIS(String bookInitials,
String reference,
int maxKeyCount)
Obtain a SAX event provider for the OSIS document representation of one
or more book entries.
|
String |
getPlainText(String bookInitials,
String reference)
Get just the canonical text of one or more book entries without any
markup.
|
void |
installBook() |
static void |
main(String[] args)
Quick Demo
|
void |
pickBible()
This is an example of the different ways to select a Book from the
selection available.
|
(package private) void |
rankedSearch()
An example of how to perform a ranked search.
|
void |
readDictionary()
While Bible and Commentary are very similar, a Dictionary is read in a
slightly different way.
|
String |
readStyledText(String bookInitials,
String reference,
int maxKeyCount)
Obtain styled text (in this case HTML) for a book reference.
|
void |
search()
An example of how to search for various bits of data.
|
(package private) void |
searchAndShow()
An example of how to do a search and then get text for each range of
verses.
|
private static final String BIBLE_NAME
public Book getBook(String bookInitials)
bookInitials
- The book name to search forpublic String getPlainText(String bookInitials, String reference) throws BookException, NoSuchKeyException
bookInitials
- the book to usereference
- a reference, appropriate for the book, of one or more entriesBookException
NoSuchKeyException
public SAXEventProvider getOSIS(String bookInitials, String reference, int maxKeyCount) throws BookException, NoSuchKeyException
bookInitials
- the book to usereference
- a reference, appropriate for the book, of one or more entriesmaxKeyCount
- BookException
NoSuchKeyException
public String readStyledText(String bookInitials, String reference, int maxKeyCount) throws NoSuchKeyException, BookException, TransformerException, SAXException
bookInitials
- the book to usereference
- a reference, appropriate for the book, of one or more entriesmaxKeyCount
- NoSuchKeyException
BookException
TransformerException
SAXException
Book
,
SAXEventProvider
public void readDictionary() throws BookException
BookException
Book
public void search() throws BookException
BookException
void rankedSearch() throws BookException
BookException
void searchAndShow() throws BookException, SAXException
BookException
SAXException
public void pickBible()
public void installBook()
public static void main(String[] args) throws BookException, NoSuchKeyException, TransformerException, SAXException
args
- NoSuchKeyException
BookException
SAXException
TransformerException