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

## org.crosswire.jsword.book.sword
Class ConfigEntry

    java.lang.Object
      org.crosswire.jsword.book.sword.ConfigEntry

    public class ConfigEntry

extends Object

A ConfigEntry holds the value(s) for an entry of ConfigEntryType.

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: ConfigEntry.java,v 1.12 2005/03/21 23:28:08 dmsmith Exp $
Author:
  DM Smith [ dmsmith555 at hotmail dot com]
See Also:
  `Licence`

Field Summary
`private static Histogram` | `histogram` A histogram for debugging.
`private String` | `internal`
`private static Logger` | `log` The log stream
`private String` | `name`
`private ConfigEntryType` | `type`
`private String` | `value`
`private List` | `values`

Constructor Summary
`ConfigEntry(String moduleName, ConfigEntryType aType, String aValue)` Create a ConfigEntry directly with an initial value.
`ConfigEntry(String moduleName, String aName)` Create a ConfigEntry whose type is not certain and whose value is not known.

Method Summary
`void` | `addValue(String aValue)` Add a value to the list of values for this ConfigEntry
`boolean` | `allowsContinuation()` While most fields are single line or single value, some allow continuation.
`boolean` | `allowsRTF()` RTF is allowed in a few config entries.
`static void` | `dumpStatistics()`
`boolean` | `equals(Object obj)`
`String` | `getName()` Get the key of this ConfigEntry
`ConfigEntryType` | `getType()` Get the type of this ConfigEntry
`Object` | `getValue()` Get the value(s) of this ConfigEntry.
`private String` | `handleRTF(String aValue)`
`int` | `hashCode()`
`boolean` | `isAllowed(String aValue)` Determines whether the string is allowed.
`boolean` | `isSupported()` Determine whether this config entry is supported.
`boolean` | `match(Object search)` Determine whether this Config entry matches the value.
`boolean` | `mayRepeat()` Some keys can repeat.
`private List` | `processLines(OSISUtil.ObjectFactory factory, String aValue)`
`boolean` | `reportDetails()`
`static void` | `resetStatistics()`
`org.jdom.Element` | `toOSIS()`
`String` | `toString()`

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

Field Detail

### log

    private static final Logger log

  The log stream

### histogram

    private static Histogram histogram

  A histogram for debugging.

### type

    private ConfigEntryType type

### internal

    private String internal

### name

    private String name

### values

    private List values

### value

    private String value

Constructor Detail

### ConfigEntry

    public ConfigEntry(String moduleName,
                       String aName)

  Create a ConfigEntry whose type is not certain and whose value is not known.

  Parameters:
    `moduleName` - the internal name of the module
    `aName` - the name of the ConfigEntry.

### ConfigEntry

    public ConfigEntry(String moduleName,
                       ConfigEntryType aType,
                       String aValue)

  Create a ConfigEntry directly with an initial value.

  Parameters:
    `moduleName` - the internal name of the module
    `aType` - the kind of ConfigEntry
    `aValue` - the initial value for the ConfigEntry

Method Detail

### getName

    public String getName()

  Get the key of this ConfigEntry

### getType

    public ConfigEntryType getType()

  Get the type of this ConfigEntry

### isAllowed

    public boolean isAllowed(String aValue)

  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:
    `aValue` -
  Returns:
    true if the string is allowed

### 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

### reportDetails

    public boolean reportDetails()

### isSupported

    public boolean isSupported()

  Determine whether this config entry is supported.

  Returns:
    true if this ConfigEntry has a type.

### getValue

    public Object getValue()

  Get the value(s) of this ConfigEntry. If mayRepeat() == true then it returns a List. Otherwise it returns a string.

  Returns:
    a list, value or null.

### match

    public boolean match(Object search)

  Determine whether this Config entry matches the value.

  Parameters:
    `search` - the value to match against
  Returns:
    true if this ConfigEntry matches the value

### addValue

    public void addValue(String aValue)

  Add a value to the list of values for this ConfigEntry

### toOSIS

    public org.jdom.Element toOSIS()

### resetStatistics

    public static void resetStatistics()

### dumpStatistics

    public static void dumpStatistics()

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### handleRTF

    private String handleRTF(String aValue)

### processLines

    private List processLines(OSISUtil.ObjectFactory factory,
                              String aValue)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ? 2003-2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD