org.crosswire.jsword.book.sword
Enum SwordMetaDataLocator

java.lang.Object
  extended by java.lang.Enum<SwordMetaDataLocator>
      extended by org.crosswire.jsword.book.sword.SwordMetaDataLocator
All Implemented Interfaces:
Serializable, Comparable<SwordMetaDataLocator>, MetaDataLocator

public enum SwordMetaDataLocator
extends Enum<SwordMetaDataLocator>
implements MetaDataLocator

The different levels of configuration. The order in this enum is important as it determines the precedence. The higher the ordinal, the higher the precedence (i.e. override).

Author:
DM Smith
See Also:
The GNU Lesser General Public License for details.

Enum Constant Summary
FRONTEND
           
JSWORD
           
SWORD
           
 
Method Summary
protected static File getFile(URI u)
          Safely creates the file location, or null if the parent can't exist
abstract  File getReadLocation()
          A read-only folder containing configuration data for books.
abstract  File getWriteLocation()
          A writable folder containing configuration data for books.
static SwordMetaDataLocator valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SwordMetaDataLocator[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SWORD

public static final SwordMetaDataLocator SWORD

JSWORD

public static final SwordMetaDataLocator JSWORD

FRONTEND

public static final SwordMetaDataLocator FRONTEND
Method Detail

values

public static SwordMetaDataLocator[] 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 (SwordMetaDataLocator c : SwordMetaDataLocator.values())
    System.out.println(c);

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

valueOf

public static SwordMetaDataLocator 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

getFile

protected static File getFile(URI u)
Safely creates the file location, or null if the parent can't exist

Parameters:
u - the parent URI
Returns:
the file representing the config

getReadLocation

public abstract File getReadLocation()
Description copied from interface: MetaDataLocator
A read-only folder containing configuration data for books. May return null or a folder that does not exist.

Specified by:
getReadLocation in interface MetaDataLocator
Returns:
the config folder

getWriteLocation

public abstract File getWriteLocation()
Description copied from interface: MetaDataLocator
A writable folder containing configuration data for books. May return null or a folder that does not exist.

Specified by:
getWriteLocation in interface MetaDataLocator
Returns:
the config folder

Copyright ยจ 2003-2015