public class NullBackend extends Object implements Backend
The GNU Lesser General Public License for details.
Constructor and Description |
---|
NullBackend() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Key key)
Determine whether this Book contains the key in question
|
void |
create()
Create the directory to hold the Book if it does not exist.
|
void |
decipher(byte[] data)
Decipher the data in place, if it is enciphered and there is a key to
unlock it.
|
void |
encipher(byte[] data)
Encipher the data in place, if there is a key to unlock it.
|
SwordBookMetaData |
getBookMetaData() |
Key |
getGlobalKeyList()
Gets the fast global key list, and if this operation is not supported, throws a
UnsupportedOperationException |
String |
getRawText(Key key)
Get the text as it is found in the Book for the given key
|
int |
getRawTextLength(Key key)
Determine the size of the raw data for the key in question.
|
boolean |
isSupported()
Returns whether this AbstractBackend is implemented.
|
boolean |
isWritable()
A Backend is writable if the file system allows the underlying files to
be opened for writing and if the backend has implemented writing.
|
Key |
readIndex()
Initialize a AbstractBackend before use.
|
List |
readToOsis(Key key,
RawTextToXmlProcessor processor)
Get the text allotted for the given entry
|
void |
setAliasKey(Key alias,
Key source) |
public SwordBookMetaData getBookMetaData()
getBookMetaData
in interface Backend
public void decipher(byte[] data)
Backend
public void encipher(byte[] data)
Backend
public Key readIndex()
Backend
public boolean contains(Key key)
Backend
public String getRawText(Key key) throws BookException
Backend
getRawText
in interface Backend
key
- the key for which the raw text is desired.BookException
public void setAliasKey(Key alias, Key source) throws BookException
setAliasKey
in interface Backend
BookException
public int getRawTextLength(Key key)
Backend
getRawTextLength
in interface Backend
key
- The key whose raw data length is desired.public Key getGlobalKeyList() throws BookException
Backend
UnsupportedOperationException
getGlobalKeyList
in interface Backend
BookException
- the book exception if for some reason the book failed to be read properly.public List readToOsis(Key key, RawTextToXmlProcessor processor) throws BookException
Backend
readToOsis
in interface Backend
key
- The key to fetchprocessor
- processor that executes before/after the content is read from
disk or another kind of backendBookException
- If the data can not be read.public void create() throws IOException, BookException
Backend
create
in interface Backend
IOException
BookException
public boolean isSupported()
Backend
isSupported
in interface Backend
public boolean isWritable()
Backend
isWritable
in interface Backend