org.crosswire.jsword.book.sword

## Class SwordBookDriver

- java.lang.Object
- - org.crosswire.jsword.book.basic.AbstractBookDriver
  - - org.crosswire.jsword.book.sword.SwordBookDriver

- All Implemented Interfaces:
    BookDriver, BookProvider

      public class SwordBookDriver
      extends AbstractBookDriver

  This represents all of the Sword Books (aka modules).
  Author:
    Joe Walker, DM Smith
  See Also:
    `The GNU Lesser General Public License for details.
    The copyright to this program is held by its authors.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static BookDriver` | `INSTANCE` A shared instance of this driver.
    `private static org.slf4j.Logger` | `LOGGER` The log stream

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwordBookDriver()` Some basic name initialization

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `private Book` | `createBook(SwordBookMetaData sbmd)` Create a Book appropriate for the BookMetaData
    `void` | `delete(Book dead)` Delete this Book from the system.
    `Book[]` | `getBooks()` Provide books.
    `private void` | `getBooks(Set<Book> valid, File bookDir)`
    `String` | `getDriverName()` A short name for this BookDriver
    `static BookDriver` | `instance()` Get the singleton instance of this driver.
    `boolean` | `isDeletable(Book dead)` Is this book able to be deleted.
    `static void` | `registerNewBook(SwordBookMetaData sbmd)` A helper class for the SwordInstaller to tell us that it has copied a new Book into our install directory

    - ### Methods inherited from class org.crosswire.jsword.book.basic.AbstractBookDriver

      `create, getFirstBook, isWritable`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          private static final BookDriver INSTANCE

      A shared instance of this driver.

    - #### LOGGER

          private static final org.slf4j.Logger LOGGER

      The log stream

  - ### Constructor Detail

    - #### SwordBookDriver

          public SwordBookDriver()

      Some basic name initialization

  - ### Method Detail

    - #### getDriverName

          public String getDriverName()

      Description copied from interface: `BookDriver`
      A short name for this BookDriver
      Returns:
        a short name for this BookDriver

    - #### getBooks

          public Book[] getBooks()

      Description copied from interface: `BookProvider`
      Provide books.
      Returns:
        the books

    - #### getBooks

          private void getBooks(Set<Book> valid,
                      File bookDir)

    - #### isDeletable

          public boolean isDeletable(Book dead)

      Description copied from interface: `BookDriver`
      Is this book able to be deleted.
      Specified by:
        `isDeletable` in interface `BookDriver`
      Overrides:
        `isDeletable` in class `AbstractBookDriver`
      Parameters:
        `dead` - the book to be deleted
      Returns:
        whether the book can be deleted.

    - #### delete

          public void delete(Book dead)
                      throws BookException

      Description copied from interface: `BookDriver`
      Delete this Book from the system. Take care with this method for obvious reasons. For most implementations of Book etc, this method will throw up because most will be read-only.
      Specified by:
        `delete` in interface `BookDriver`
      Overrides:
        `delete` in class `AbstractBookDriver`
      Parameters:
        `dead` - the book to be deleted
      Throws:
        `BookException` - If the Book can't be deleted.

    - #### instance

          public static BookDriver instance()

      Get the singleton instance of this driver.
      Returns:
        this driver instance

    - #### registerNewBook

          public static void registerNewBook(SwordBookMetaData sbmd)
                                      throws BookException

      A helper class for the SwordInstaller to tell us that it has copied a new Book into our install directory
      Parameters:
        `sbmd` - The SwordBookMetaData object for the new Book
      Throws:
        `BookException`

    - #### createBook

          private Book createBook(SwordBookMetaData sbmd)
                           throws BookException

      Create a Book appropriate for the BookMetaData
      Throws:
        `BookException`