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.PassageAbstractBook
          extended by org.crosswire.jsword.book.sword.SwordBook
All Implemented Interfaces:
Comparable, Activatable, Book, BookMetaData, KeyFactory

public class SwordBook
extends PassageAbstractBook

SwordBook is a base class for all sword type modules.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: SwordBook.java,v 1.16 2005/03/19 01:56:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private  Backend backend
          To read the data from the disk
private  SwordBookMetaData sbmd
          The Sword configuration file
 
Fields inherited from interface org.crosswire.jsword.book.BookMetaData
KEY_BOOK, KEY_DRIVER, KEY_INDEXSTATUS, KEY_INITIALS, KEY_LANGUAGE, KEY_NAME, KEY_TYPE
 
Constructor Summary
SwordBook(SwordBookMetaData sbmd, Backend 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.PassageAbstractBook
createEmptyKeyList, getData, getGlobalKeyList, getKey, getRawData, setDocument
 
Methods inherited from class org.crosswire.jsword.book.basic.AbstractBook
addPropertyChangeListener, compareTo, equals, find, getBook, getBookMetaData, getDriver, getDriverName, getFullName, getIndexStatus, getInitials, getLanguage, getName, getOsisID, getProperties, getType, hasFeature, hashCode, isLeftToRight, removePropertyChangeListener, setBookMetaData, setIndexStatus, toOSIS, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

backend

private Backend backend
To read the data from the disk


sbmd

private SwordBookMetaData sbmd
The Sword configuration file

Constructor Detail

SwordBook

public SwordBook(SwordBookMetaData sbmd,
                 Backend 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 PassageAbstractBook
Throws:
BookException

addOSIS

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

Overrides:
addOSIS in class PassageAbstractBook
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: PassageAbstractBook
Set the unparsed text for a verse to permanent storage.

Specified by:
setText in class PassageAbstractBook
Throws:
BookException

getFilter

protected Filter getFilter()
Description copied from class: PassageAbstractBook
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 PassageAbstractBook and it doesn't like any higher in the hierachy at the moment so I will leave this here.

Specified by:
getFilter in class PassageAbstractBook

Copyright ? 2003-2004