org.crosswire.jsword.book
Class BookData

java.lang.Object
  extended by org.crosswire.jsword.book.BookData

public class BookData
extends Object

Basic section of BookData.

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: BookData.java,v 1.10 2005/03/06 20:21:47 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private  Book book
          Who created this data
private  Key key
          What key was used to create this data
private  org.jdom.Element osis
          The root where we read data from
 
Constructor Summary
BookData(org.jdom.Element osis, Book book, Key key)
          Ctor
BookData(SAXEventProvider provider, Book book, Key key)
          Create a BibleData from a SAXEventProvider
 
Method Summary
 Book getBook()
          Who created this data.
 Key getKey()
          What key was used to create this data.
 org.jdom.Element getOsis()
          Accessor for the root OSIS element
 String getPlainText()
          A simplified plain text version of the data in this document with all the markup stripped out.
 SAXEventProvider getSAXEventProvider()
          Output the current data as a SAX stream.
 void validate()
          Check that a BibleData is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

book

private Book book
Who created this data


key

private Key key
What key was used to create this data


osis

private org.jdom.Element osis
The root where we read data from

Constructor Detail

BookData

public BookData(org.jdom.Element osis,
                Book book,
                Key key)
Ctor


BookData

public BookData(SAXEventProvider provider,
                Book book,
                Key key)
         throws SAXException
Create a BibleData from a SAXEventProvider

Throws:
SAXException
Method Detail

getOsis

public org.jdom.Element getOsis()
Accessor for the root OSIS element


getPlainText

public String getPlainText()
A simplified plain text version of the data in this document with all the markup stripped out.

Returns:
The Bible text without markup

validate

public void validate()
Check that a BibleData is valid. Currently, this does nothing, and isn't used. it was broken when we used JAXB, however it wasn't much use then becuase JAXB did a lot to keep the document valid anyway. Under JDOM there is more point, but I don't think JDOM supports this out of the box.


getSAXEventProvider

public SAXEventProvider getSAXEventProvider()
Output the current data as a SAX stream.

Returns:
A way of posting SAX events

getBook

public Book getBook()
Who created this data.

Returns:
Returns the book.

getKey

public Key getKey()
What key was used to create this data. It should be true that bookdata.getBook().getBookData(bookdata.getKey()) equals (but not necessarily ==) the original bookdata.

Returns:
Returns the key.

Copyright ? 2003-2004