public interface Book extends Activatable, Comparable<Book>
The GNU Lesser General Public License for details.
Modifier and Type | Method and Description |
---|---|
void |
addIndexStatusListener(IndexStatusListener li)
Adds a
IndexStatusListener to the listener list. |
boolean |
contains(Key key)
Returns true if this book contains the specified element.
|
Key |
createEmptyKeyList()
Fetch an empty Key to which we can add Keys.
|
Key |
find(SearchRequest request)
Retrieval: For a given search spec find a list of references to it.
|
Key |
find(String request)
Retrieval: For a given search spec find a list of references to it.
|
String |
getAbbreviation()
The abbreviation of this book - how people familiar with this book will know
it, for example "NIV", "KJV".
|
BookCategory |
getBookCategory()
What category of content is this, a Bible or a reference work like a
Dictionary or Commentary.
|
BookMetaData |
getBookMetaData()
Meta-Information: What version of the Bible is this?
|
BookDriver |
getDriver()
Accessor for the driver that runs this Book.
|
String |
getDriverName()
Calculated field: The name of the name, which could be helpful to
distinguish similar Books available through 2 BookDrivers.
|
Key |
getGlobalKeyList()
Get a complete list of index entries.
|
IndexStatus |
getIndexStatus()
Has anyone generated a search index for this Book?
|
String |
getInitials()
The internal name of this book.
|
Key |
getKey(String name)
Someone has typed in a reference to find, but we need a Key to actually
look it up.
|
Language |
getLanguage()
The language of the book.
|
String |
getName()
The name of the book, for example "King James Version" or
"Bible in Basic English" or "Greek".
|
String |
getOsisID()
Calculated field: Get an OSIS identifier for the OsisText.setOsisIDWork()
and the Work.setOsisWork() methods.
|
Iterator<org.jdom2.Content> |
getOsisIterator(Key key,
boolean allowEmpty,
boolean allowGenTitles)
Return an iterator that returns each key's OSIS in turn.
|
String |
getProperty(String key)
Retrieve a single property for this book.
|
Set<String> |
getPropertyKeys()
Get a list of all the properties available to do with this Book.
|
String |
getRawText(Key key)
Returns the raw text that getData(Key key) builds into OSIS.
|
Key |
getScope()
Get a complete list of entries.
|
String |
getUnlockKey()
Gets the unlock key for the module.
|
Key |
getValidKey(String name)
Get a Key for the name, if possible.
|
boolean |
hasFeature(FeatureType feature)
Return whether the feature is supported by the book.
|
boolean |
isEnciphered()
Indicate whether this book is enciphered.
|
boolean |
isLeftToRight()
Return the orientation of the script of the Book.
|
boolean |
isLocked()
Indicate whether this book is enciphered and without a key.
|
boolean |
isQuestionable()
Indicate whether this book is questionable.
|
boolean |
isSupported()
Indicate whether this book is supported by JSword.
|
boolean |
isWritable()
A Book is writable if the file system allows the underlying files to be
opened for writing and if the driver for the book allows writing.
|
boolean |
match(String name)
Return the likelihood that we have a match.
|
void |
putProperty(String key,
String value)
Set a property for this book.
|
void |
putProperty(String key,
String value,
boolean forFrontend)
Saves an entry to a particular configuration file.
|
void |
removeIndexStatusListener(IndexStatusListener li)
Removes a
IndexStatusListener from the listener list. |
void |
setAliasKey(Key alias,
Key source)
Store an alias of one key to another.
|
void |
setBookMetaData(BookMetaData bmd)
Set the meta-information for this book.
|
void |
setIndexStatus(IndexStatus status)
This method does not alter the index status, however it is for Indexers
that are responsible for indexing and have changed the status themselves.
|
void |
setRawText(Key key,
String rawData)
Store the raw text for the given key.
|
org.jdom2.Document |
toOSIS()
Get an OSIS representation of information concerning this Book.
|
boolean |
unlock(String unlockKey)
Unlocks a book with the given key.
|
activate, deactivate
compareTo
Key getGlobalKeyList()
Key getScope()
getGlobalKeyList()
, however for a Bible, it will
get the references that are actually in the book.Key getValidKey(String name)
name
- The string to translate into a KeyKey getKey(String name) throws NoSuchKeyException
name
- The string to translate into a KeyNoSuchKeyException
- If the name can not be parsed.Key createEmptyKeyList()
BookMetaData getBookMetaData()
void setBookMetaData(BookMetaData bmd)
bmd
- the BookMetaData that describes this book.Iterator<org.jdom2.Content> getOsisIterator(Key key, boolean allowEmpty, boolean allowGenTitles) throws BookException
key
- the Items to locateallowEmpty
- indicates whether empty keys should be present.allowGenTitles
- indicates whether to generate titlesBookException
- If anything goes wrong with this methodboolean contains(Key key)
key
- element whose presence in this book is to be tested.String getRawText(Key key) throws BookException
key
- The item to locateBookException
- If anything goes wrong with this methodboolean isWritable()
void setRawText(Key key, String rawData) throws BookException
key
- The item to locaterawData
- The text to storeBookException
- If anything goes wrong with this methodvoid setAliasKey(Key alias, Key source) throws BookException
It should be an exception to set an alias when that alias already has raw text. Also, it should be an exception to set an alias to an alias. However, getRawText(Key) must be able to handle alias chains.
alias
- the key that aliases anothersource
- the key that holds the textBookException
- If anything goes wrong with this methodKey find(SearchRequest request) throws BookException
request
- The search spec.BookException
- If anything goes wrong with this methodKey find(String request) throws BookException
request
- The search spec.BookException
- If anything goes wrong with this methodString getName()
BookCategory getBookCategory()
BookDriver getDriver()
Language getLanguage()
String getAbbreviation()
String getInitials()
String getOsisID()
boolean match(String name)
name
- one of many ways to name this book.boolean isSupported()
boolean isEnciphered()
boolean isLocked()
boolean unlock(String unlockKey)
unlockKey
- the key to tryString getUnlockKey()
boolean isQuestionable()
String getDriverName()
boolean isLeftToRight()
boolean hasFeature(FeatureType feature)
feature
- the type of the Feature to checkSet<String> getPropertyKeys()
String getProperty(String key)
key
- the key of the property.void putProperty(String key, String value)
key
- the key of the property.value
- the value of the propertyvoid putProperty(String key, String value, boolean forFrontend)
key
- the entry that we are savingvalue
- the value of the entryforFrontend
- when true
save to front end storage, else in shared storageIndexStatus getIndexStatus()
IndexManager
void setIndexStatus(IndexStatus status)
status
- the status to set for this bookIndexManager
org.jdom2.Document toOSIS()
void addIndexStatusListener(IndexStatusListener li)
IndexStatusListener
to the listener list.
A IndexStatusEvent
will get fired in response to
setIndexStatus
.
li
- the IndexStatusListener
to be addedvoid removeIndexStatusListener(IndexStatusListener li)
IndexStatusListener
from the listener list.li
- the IndexStatusListener
to be removed