org.crosswire.jsword.book.sword
Class SwordBook

java.lang.Object
  extended by org.crosswire.jsword.book.basic.AbstractBook
      extended by org.crosswire.jsword.book.basic.AbstractPassageBook
          extended by org.crosswire.jsword.book.sword.SwordBook
All Implemented Interfaces:
Comparable, Activatable, Book, KeyFactory

public class SwordBook
extends AbstractPassageBook

SwordBook is a base class for all sword type books.

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
private  AbstractBackend backend
          To read the data from the disk
private  SwordBookMetaData sbmd
          The Sword configuration file
 
Constructor Summary
SwordBook(SwordBookMetaData sbmd, AbstractBackend backend)
          Simple ctor
 
Method Summary
 void activate(Lock lock)
          Called to indicate that the Book should initialize itself, and consume whatever system resources it needs to be able to respond to other queries.
 void addOSIS(Key key, org.jdom.Element div, List osisContent)
          Add the OSIS elements to the div element.
 void deactivate(Lock lock)
          Called to indicate that the Book should release whatever system resources it can to make way for other uses.
protected  Filter getFilter()
          What filter should be used to filter data in the format produced by this Book?.
protected  String getText(Key key)
          Read the unfiltered data for a given key
protected  void setText(Verse verse, String text)
          Set the unparsed text for a verse to permanent storage.
 
Methods inherited from class org.crosswire.jsword.book.basic.AbstractPassageBook
createEmptyKeyList, getData, getGlobalKeyList, getKey, getRawData, getValidKey, setDocument
 
Methods inherited from class org.crosswire.jsword.book.basic.AbstractBook
addIndexStatusListener, compareTo, equals, find, find, firePropertyChange, getBook, getBookCategory, getBookMetaData, getDriver, getDriverName, getFullName, getIndexStatus, getInitials, getLanguage, getName, getOsisID, getProperties, getUnlockKey, hasFeature, hashCode, isEnciphered, isLeftToRight, isLocked, isQuestionable, isSupported, removeIndexStatusListener, setBookMetaData, setIndexStatus, toOSIS, toString, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

backend

private AbstractBackend backend
To read the data from the disk


sbmd

private SwordBookMetaData sbmd
The Sword configuration file

Constructor Detail

SwordBook

public SwordBook(SwordBookMetaData sbmd,
                 AbstractBackend backend)
Simple ctor

Method Detail

activate

public final void activate(Lock lock)
Description copied from interface: Activatable
Called to indicate that the Book should initialize itself, and consume whatever system resources it needs to be able to respond to other queries.

Specified by:
activate in interface Activatable
Overrides:
activate in class AbstractBook
Parameters:
lock - An attempt to ensure that only the Activator calls this method

deactivate

public final void deactivate(Lock lock)
Description copied from interface: Activatable
Called to indicate that the Book should release whatever system resources it can to make way for other uses.

Specified by:
deactivate in interface Activatable
Overrides:
deactivate in class AbstractBook
Parameters:
lock - An attempt to ensure that only the Activator calls this method

getText

protected String getText(Key key)
                  throws BookException
Read the unfiltered data for a given key

Specified by:
getText in class AbstractPassageBook
Throws:
BookException

addOSIS

public void addOSIS(Key key,
                    org.jdom.Element div,
                    List osisContent)
Description copied from class: AbstractPassageBook
Add the OSIS elements to the div element. Note, this assumes that the data is fully marked up.

Overrides:
addOSIS in class AbstractPassageBook
Parameters:
key - The key being added
div - The div element to which the key is being added
osisContent - The OSIS representation of the key being added.

setText

protected void setText(Verse verse,
                       String text)
                throws BookException
Description copied from class: AbstractPassageBook
Set the unparsed text for a verse to permanent storage.

Specified by:
setText in class AbstractPassageBook
Throws:
BookException

getFilter

protected Filter getFilter()
Description copied from class: AbstractPassageBook
What filter should be used to filter data in the format produced by this Book?. In some ways this method is more suited to BookMetaData however we do not have a specialization of BookMetaData to fit AbstractPassageBook and it doesn't like any higher in the hierachy at the moment so I will leave this here.

Specified by:
getFilter in class AbstractPassageBook

Copyright ยจ 2003-2006