|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.book.sword.AbstractBackend<T>
T
- The type of the OpenFileState that this class extends.public abstract class AbstractBackend<T extends OpenFileState>
A generic way to read data from disk for later formatting.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private SwordBookMetaData |
bmd
|
private Versification |
versificationSystem
|
Constructor Summary | |
---|---|
AbstractBackend()
Default constructor for the sake of serialization. |
|
AbstractBackend(SwordBookMetaData sbmd)
Construct a minimal backend |
Method Summary | |
---|---|
abstract 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 |
Versification |
getVersification()
|
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. |
private void |
readNormalOsis(Key key,
RawTextToXmlProcessor processor,
List<org.jdom2.Content> content,
T openFileState)
|
private Verse |
readPassageOsis(Key key,
RawTextToXmlProcessor processor,
List<org.jdom2.Content> content,
T openFileState)
Reads a passage as OSIS |
List<org.jdom2.Content> |
readToOsis(Key key,
RawTextToXmlProcessor processor)
Get the text allotted for the given entry |
private void |
throwFailedKeyException(Key masterKey,
Key currentKey,
IOException e)
If non-null, currentKey is used to throw the exception, other, masterKey is used instead, which will be more general. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.crosswire.jsword.book.sword.StatefulFileBackedBackend |
---|
initState, readRawContent, setAliasKey, setRawText |
Field Detail |
---|
private SwordBookMetaData bmd
private Versification versificationSystem
Constructor Detail |
---|
public AbstractBackend()
public AbstractBackend(SwordBookMetaData sbmd)
sbmd
- Method Detail |
---|
public SwordBookMetaData getBookMetaData()
public void decipher(byte[] data)
data
- the data to unlockpublic void encipher(byte[] data)
data
- public Key readIndex()
public abstract boolean contains(Key key)
key
- The key whose presence is desired.
public Key getGlobalKeyList() throws BookException
UnsupportedOperationException
BookException
- the book exception if for some reason the book failed to be read properly.public List<org.jdom2.Content> readToOsis(Key key, RawTextToXmlProcessor processor) throws BookException
key
- The key to fetchprocessor
- processor that executes before/after the content is read from
disk or another kind of backend
BookException
- If the data can not be read.private void readNormalOsis(Key key, RawTextToXmlProcessor processor, List<org.jdom2.Content> content, T openFileState) throws BookException
BookException
private Verse readPassageOsis(Key key, RawTextToXmlProcessor processor, List<org.jdom2.Content> content, T openFileState) throws BookException
key
- the given keyprocessor
- a processor for which to do things withcontent
- a list of content to be appended to (i.e. the OSIS data)openFileState
- the open file state, from which we read things
BookException
- a book exception if we failed to read the bookprivate void throwFailedKeyException(Key masterKey, Key currentKey, IOException e) throws BookException
masterKey
- the key containing currentKeycurrentKey
- the currentKeye
- the exception that occured
BookException
- always thrown, a BookException
public void create() throws IOException, BookException
IOException
BookException
public boolean isSupported()
public boolean isWritable()
public Versification getVersification()
|
Copyright ? 2003-2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |