Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD

## org.crosswire.jsword.book.sword
Enum ConfigEntryType

    java.lang.Object
      java.lang.Enum<ConfigEntryType>
          org.crosswire.jsword.book.sword.ConfigEntryType

All Implemented Interfaces:
  Serializable, Comparable<ConfigEntryType>

     enum ConfigEntryType

extends Enum<ConfigEntryType>

Enumeration of SWORD config file keys and their characteristics. The purpose of this enumeration is to allow validation of a SWORD config file.

     Originally from:
         http://sword.sourceforge.net/cgi-bin/twiki/view/Swordapi/ConfFileLayout
     Then located at:
         http://www.crosswire.org/ucgi-bin/twiki/view/Swordapi/ConfFileLayout
     Then located at:
         http://www.crosswire.org/wiki/index.php/DevTools:Modules
     Now located at:
         http://www.crosswire.org/wiki/DevTools:confFiles

Note: This file is organized the same as the latest wiki documentation.

Key characteristics:

- Data Type -- Most values are text, but some are integer, date, boolean.
- Data Format -- Some text is constrained to patterns.
- Multiple Values -- Some keys allow more than one value. Others only allow only one
- RTF -- Some keys allow RTF formatting of values.
- HTML -- Some keys allow HTML.
- Pick list -- Some keys allow a value from a pick list
- Default values -- Some keys have default values.
- Localization -- Some keys can be internationalized and localized.

Author:
  Joe Walker, DM Smith
See Also:
  `The GNU Lesser General Public License for details.`

Enum Constant Summary
`ABBREVIATION` The short name of this book.
`ABOUT` Contains rtf that describes the book.
`BLOCK_COUNT` single value integer, unknown use, some indications that we ought to be using it
`BLOCK_TYPE` The level at which compression is applied, BOOK, CHAPTER, or VERSE
`BOOK_LIST` New.
`CATEGORY` The Category of the book.
`CIPHER_KEY` If this exists in the conf, then the book is encrypted.
`COMPRESS_TYPE` The type of compression in use.
`COPYRIGHT` Informational copyright notice.
`COPYRIGHT_CONTACT_ADDRESS` Copyright info.
`COPYRIGHT_CONTACT_EMAIL` Copyright info.
`COPYRIGHT_CONTACT_NAME` Copyright info.
`COPYRIGHT_CONTACT_NOTES` Copyright info.
`COPYRIGHT_DATE` Copyright info.
`COPYRIGHT_HOLDER` single value string, unknown use
`COPYRIGHT_NOTES` Copyright info.
`DATA_PATH` Relative path to the data files, some issues with this
`DESCRIPTION` The full name of this book
`DIRECTION` The layout direction of the text in the book.
`DISPLAY_LEVEL` Display level is used by GenBooks to do auto expansion in the tree.
`DISTRIBUTION_LICENSE` Copyright info.
`DISTRIBUTION_NOTES` Copyright info.
`DISTRIBUTION_SOURCE` Deliberately not in wiki.
`ENCODING` The character encoding.
`FEATURE` A Feature describes a characteristic of the Book.
`FONT` A recommended font to use for the book.
`GLOBAL_OPTION_FILTER` Global Option Filters are the names of routines in SWORD that can be used to display the data.
`GLOSSARY_FROM` Books with a Feature of Glossary are used to map words FROM one language TO another.
`GLOSSARY_TO` Books with a Feature of Glossary are used to map words FROM one language TO another.
`HISTORY` multiple values starting with History, some sort of change-log.
`INSTALL_SIZE` The installed size of the book in bytes.
`KEY_TYPE` The kind of key that a Generic Book uses.
`LANG` single value string, defaults to en, the language of the book
`LCSH` Library of Congress Subject Heading.
`LOCAL_STRIP_FILTER` New.
`MINIMUM_VERSION` single value version number, lowest sword c++ version that can read this book JSword does not use this value.
`MOD_DRV` This indicates how the book was stored.
`OBSOLETES` A list of prior "initials" for the current book.
`OSIS_Q_TO_TICK` When false do not show quotation marks for OSIS text that has elements.
`OSIS_VERSION` Single value version number, lowest sword c++ version that can read this book JSword does not use this value.
`PREFERRED_CSS_XHTML` Names a file in the module's DataPath that should be referenced for the renderer as CSS display controls.
`SCOPE` New.
`SEARCH_OPTION` New.
`SHORT_COPYRIGHT` A one line copyright statement, required by Lockman for NASB
`SHORT_PROMO` A one line promo statement, required by Lockman for NASB
`SOURCE_TYPE` This indicates the kind of markup used for the book.
`STRONGS_PADDING` Names a file in the module's DataPath that should be referenced for the renderer as CSS display controls.
`SWORD_VERSION_DATE` The date that this version of the book was last updated.
`TEXT_SOURCE` Information on where the book's text was obtained.
`UNLOCK_URL` Contains the URL (a bare URL, not an HTML link) of a web page for unlocking instructions/payment.
`VERSIFICATION` This indicates the versification of the book, with KJV being the default.
`VERSION` An informational string indicating the current version of the book.

Field Summary
`private Object` | `defaultValue` The default for the ConfigEntryType
`static String` | `DIRECTION_BIDI`
`static String` | `DIRECTION_LTOR` Constants for direction
`static String` | `DIRECTION_RTOL`
`private String` | `name` The name of the ConfigEntryType
`private String[]` | `picks` The array of choices.

Method Summary
`boolean` | `allowsContinuation()` While most fields are single line or single value, some allow continuation.
`boolean` | `allowsRTF()` RTF is allowed in a few config entries.
`Object` | `convert(String input)` Convert the string value from the conf into the representation of this ConfigEntryType.
`String` | `filter(String value)` Modify the value if necessary.
`static ConfigEntryType` | `fromString(String name)` Lookup method to convert from a String
`Object` | `getDefault()` Some ConfigEntryTypes have defaults.
`protected boolean` | `hasChoices()` Some keys can repeat.
`boolean` | `isAllowed(String value)` Determines whether the string is allowed.
`boolean` | `isText()` Some keys can be converted to something other than a string.
`boolean` | `mayRepeat()` Some keys can repeat.
`String` | `toString()`
`String` | `unconvert(Object internal)` Return the original representation of the object.
`static ConfigEntryType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static ConfigEntryType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### DATA_PATH

    public static final ConfigEntryType DATA_PATH

  Relative path to the data files, some issues with this

### DESCRIPTION

    public static final ConfigEntryType DESCRIPTION

  The full name of this book

### MOD_DRV

    public static final ConfigEntryType MOD_DRV

  This indicates how the book was stored.

### COMPRESS_TYPE

    public static final ConfigEntryType COMPRESS_TYPE

  The type of compression in use. While LZSS is the default, it is not used. At least so far. GZIP, BZIP2 and XZ were just added by SWORD.

### BLOCK_TYPE

    public static final ConfigEntryType BLOCK_TYPE

  The level at which compression is applied, BOOK, CHAPTER, or VERSE

### BLOCK_COUNT

    public static final ConfigEntryType BLOCK_COUNT

  single value integer, unknown use, some indications that we ought to be using it

### KEY_TYPE

    public static final ConfigEntryType KEY_TYPE

  The kind of key that a Generic Book uses.

### CIPHER_KEY

    public static final ConfigEntryType CIPHER_KEY

  If this exists in the conf, then the book is encrypted. The value is used to unlock the book. The encryption algorithm is Sapphire.

### VERSIFICATION

    public static final ConfigEntryType VERSIFICATION

  This indicates the versification of the book, with KJV being the default.

### GLOBAL_OPTION_FILTER

    public static final ConfigEntryType GLOBAL_OPTION_FILTER

  Global Option Filters are the names of routines in SWORD that can be used to display the data. These are not used by JSword.

### DIRECTION

    public static final ConfigEntryType DIRECTION

  The layout direction of the text in the book. Hebrew, Arabic and Farsi RtoL. Most are 'LtoR'. Some are 'bidi', bidirectional. E.g. Hebrew-English glossary.

### SOURCE_TYPE

    public static final ConfigEntryType SOURCE_TYPE

  This indicates the kind of markup used for the book. In SWORD, Plaintext uses the GBF filter.

### ENCODING

    public static final ConfigEntryType ENCODING

  The character encoding. Only Latin-1 and UTF-8 are supported. Internally, SWORD supports SCSU and UTF-16. Currently, there is no way to build these modules. JSword does not support SCSU.

### DISPLAY_LEVEL

    public static final ConfigEntryType DISPLAY_LEVEL

  Display level is used by GenBooks to do auto expansion in the tree. A level of 2 indicates that the first two levels should be shown.

### FONT

    public static final ConfigEntryType FONT

  A recommended font to use for the book.

### OSIS_Q_TO_TICK

    public static final ConfigEntryType OSIS_Q_TO_TICK

  When false do not show quotation marks for OSIS text that has elements.

### FEATURE

    public static final ConfigEntryType FEATURE

  A Feature describes a characteristic of the Book.

### GLOSSARY_FROM

    public static final ConfigEntryType GLOSSARY_FROM

  Books with a Feature of Glossary are used to map words FROM one language TO another.

### GLOSSARY_TO

    public static final ConfigEntryType GLOSSARY_TO

  Books with a Feature of Glossary are used to map words FROM one language TO another.

### PREFERRED_CSS_XHTML

    public static final ConfigEntryType PREFERRED_CSS_XHTML

  Names a file in the module's DataPath that should be referenced for the renderer as CSS display controls. Generality is advised: Use controls that are not specific to any particular rendering engine, e.g. WebKit.

### STRONGS_PADDING

    public static final ConfigEntryType STRONGS_PADDING

  Names a file in the module's DataPath that should be referenced for the renderer as CSS display controls. Generality is advised: Use controls that are not specific to any particular rendering engine, e.g. WebKit.

### ABBREVIATION

    public static final ConfigEntryType ABBREVIATION

  The short name of this book.

### ABOUT

    public static final ConfigEntryType ABOUT

  Contains rtf that describes the book.

### VERSION

    public static final ConfigEntryType VERSION

  An informational string indicating the current version of the book.

### HISTORY

    public static final ConfigEntryType HISTORY

  multiple values starting with History, some sort of change-log. In the conf these are of the form History_x.y. We strip off the x.y and prefix the value with it. The x.y corresponds to a current or prior Version value.

### MINIMUM_VERSION

    public static final ConfigEntryType MINIMUM_VERSION

  single value version number, lowest sword c++ version that can read this book JSword does not use this value.

### CATEGORY

    public static final ConfigEntryType CATEGORY

  The Category of the book. Used on the web to classify books into a tree.

### LCSH

    public static final ConfigEntryType LCSH

  Library of Congress Subject Heading. Typically this is of the form BookCategory Scope Language, where scope is typically O.T., N.T.

### LANG

    public static final ConfigEntryType LANG

  single value string, defaults to en, the language of the book

### INSTALL_SIZE

    public static final ConfigEntryType INSTALL_SIZE

  The installed size of the book in bytes. This is not the size of the zip that is downloaded.

### SWORD_VERSION_DATE

    public static final ConfigEntryType SWORD_VERSION_DATE

  The date that this version of the book was last updated. Informational only.

### OBSOLETES

    public static final ConfigEntryType OBSOLETES

  A list of prior "initials" for the current book. TODO(dms): when a user installs a book with an obsoletes that matches an installed book, offer the user the opportunity to delete the old book.

### OSIS_VERSION

    public static final ConfigEntryType OSIS_VERSION

  Single value version number, lowest sword c++ version that can read this book JSword does not use this value.

### COPYRIGHT

    public static final ConfigEntryType COPYRIGHT

  Informational copyright notice.

### COPYRIGHT_HOLDER

    public static final ConfigEntryType COPYRIGHT_HOLDER

  single value string, unknown use

### COPYRIGHT_DATE

    public static final ConfigEntryType COPYRIGHT_DATE

  Copyright info. Informational only. This is a year, a year range or a comma separated list of these.

### COPYRIGHT_NOTES

    public static final ConfigEntryType COPYRIGHT_NOTES

  Copyright info. Informational only.

### COPYRIGHT_CONTACT_NAME

    public static final ConfigEntryType COPYRIGHT_CONTACT_NAME

  Copyright info. Informational only.

### COPYRIGHT_CONTACT_NOTES

    public static final ConfigEntryType COPYRIGHT_CONTACT_NOTES

  Copyright info. Informational only.

### COPYRIGHT_CONTACT_ADDRESS

    public static final ConfigEntryType COPYRIGHT_CONTACT_ADDRESS

  Copyright info. Informational only.

### COPYRIGHT_CONTACT_EMAIL

    public static final ConfigEntryType COPYRIGHT_CONTACT_EMAIL

  Copyright info. Informational only.

### SHORT_PROMO

    public static final ConfigEntryType SHORT_PROMO

  A one line promo statement, required by Lockman for NASB

### SHORT_COPYRIGHT

    public static final ConfigEntryType SHORT_COPYRIGHT

  A one line copyright statement, required by Lockman for NASB

### DISTRIBUTION_LICENSE

    public static final ConfigEntryType DISTRIBUTION_LICENSE

  Copyright info. Informational only.

### DISTRIBUTION_NOTES

    public static final ConfigEntryType DISTRIBUTION_NOTES

  Copyright info. Informational only.

### TEXT_SOURCE

    public static final ConfigEntryType TEXT_SOURCE

  Information on where the book's text was obtained.

### UNLOCK_URL

    public static final ConfigEntryType UNLOCK_URL

  Contains the URL (a bare URL, not an HTML link) of a web page for unlocking instructions/payment.

### DISTRIBUTION_SOURCE

    public static final ConfigEntryType DISTRIBUTION_SOURCE

  Deliberately not in wiki. Similar to DataPath. It gives where on the CrossWire server the book can be found. Informational only.

### LOCAL_STRIP_FILTER

    public static final ConfigEntryType LOCAL_STRIP_FILTER

  New. Not in wiki. Present in SWORD engine. Present in hesychius.conf w/ PapyriPlain

### SEARCH_OPTION

    public static final ConfigEntryType SEARCH_OPTION

  New. Not in wiki. Present in SWORD engine. Present in hesychius.conf w/ IncludeKeyInSearch

### SCOPE

    public static final ConfigEntryType SCOPE

  New. Not supported by Sword but supported by IBT. Scope is an OSIS Reference of all keys contained in the book

### BOOK_LIST

    public static final ConfigEntryType BOOK_LIST

  New. Not supported by Sword. Lists of books contained in the module. Usually derived and cached in the JSword configuration files.

Field Detail

### name

    private final String name

  The name of the ConfigEntryType

### defaultValue

    private final Object defaultValue

  The default for the ConfigEntryType

### picks

    private final String[] picks

  The array of choices.

### DIRECTION_LTOR

    public static final String DIRECTION_LTOR

  Constants for direction

  See Also:
    Constant Field Values

### DIRECTION_RTOL

    public static final String DIRECTION_RTOL

See Also:
  Constant Field Values

### DIRECTION_BIDI

    public static final String DIRECTION_BIDI

See Also:
  Constant Field Values

Method Detail

### values

    public static ConfigEntryType[] values()

  Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

      for (ConfigEntryType c : ConfigEntryType.values())
          System.out.println(c);

  Returns:
    an array containing the constants of this enum type, in the order they are declared

### valueOf

    public static ConfigEntryType valueOf(String name)

  Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

  Parameters:
    `name` - the name of the enum constant to be returned.
  Returns:
    the enum constant with the specified name
  Throws:
    `IllegalArgumentException` - if this enum type has no constant with the specified name
    `NullPointerException` - if the argument is null

### isText

    public boolean isText()

  Some keys can be converted to something other than a string.

  Returns:
    true if this ConfigEntryType is a string

### isAllowed

    public boolean isAllowed(String value)

  Determines whether the string is allowed. For some config entries, the value is expected to be one of a group, for others the format is defined.

  Parameters:
    `value` - the string to be checked
  Returns:
    true if the string is allowed

### filter

    public String filter(String value)

  Modify the value if necessary.

  Parameters:
    `value` - the input
  Returns:
    either value or a modified version of it.

### allowsRTF

    public boolean allowsRTF()

  RTF is allowed in a few config entries.

  Returns:
    true if RTF is allowed

### allowsContinuation

    public boolean allowsContinuation()

  While most fields are single line or single value, some allow continuation. A continuation mark is a backslash at the end of a line. It is not to be followed by whitespace.

  Returns:
    true if continuation is allowed

### mayRepeat

    public boolean mayRepeat()

  Some keys can repeat. When this happens each is a single value pick from a list of choices.

  Returns:
    true if this ConfigEntryType can occur more than once

### hasChoices

    protected boolean hasChoices()

  Some keys can repeat. When this happens each is a single value pick from a list of choices.

  Returns:
    true if this ConfigEntryType can occur more than once

### getDefault

    public Object getDefault()

  Some ConfigEntryTypes have defaults.

  Returns:
    the default, if there is one, null otherwise

### convert

    public Object convert(String input)

  Convert the string value from the conf into the representation of this ConfigEntryType.

  Parameters:
    `input` - the text to convert
  Returns:
    the converted object

### unconvert

    public String unconvert(Object internal)

  Return the original representation of the object.

  Parameters:
    `internal` - the object to convert
  Returns:
    the original string

### fromString

    public static ConfigEntryType fromString(String name)

  Lookup method to convert from a String

  Parameters:
    `name` - the key for the entry
  Returns:
    the matching type

### toString

    public String toString()

  Overrides:
    `toString` in class `Enum<ConfigEntryType>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD