org.benow.java.config.entry
Class FileConfigurationEntry

java.lang.Object
  extended by org.benow.java.config.ConfigurationEntryImpl
      extended by org.benow.java.config.entry.StringConfigurationEntry
          extended by org.benow.java.config.entry.FileConfigurationEntry
All Implemented Interfaces:
ConfigurationEntry

public class FileConfigurationEntry
extends StringConfigurationEntry

util: org.benow.util.config.entry.FileConfigurationEntry

Author:
andy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.benow.java.config.ConfigurationEntry
ConfigurationEntry.Relevance
 
Field Summary
static boolean MAY_NOT_EXIST
           
static boolean MUST_EXIST
           
 
Fields inherited from class org.benow.java.config.ConfigurationEntryImpl
isDefault
 
Constructor Summary
protected FileConfigurationEntry()
           
  FileConfigurationEntry(java.lang.String name, java.io.File defaultValue, boolean mustExist, java.lang.String description)
           
  FileConfigurationEntry(java.lang.String name, java.util.List<?> defaultValue, boolean mustExist, java.lang.String description)
           
  FileConfigurationEntry(java.lang.String name, java.lang.String defaultValue, boolean mustExist, java.lang.String desc)
           
  FileConfigurationEntry(java.lang.String name, java.lang.String defaultValue, java.lang.String description)
          Use for explicit entry specification by passing Object.class as declaringClass, which allows for easy reference using only name, not prefix.
 
Method Summary
protected  void assertHasValue()
           
 void createIfRequired()
           
 java.io.File getFileValue()
           
 java.util.List<java.io.File> getFileValues()
           
 java.lang.Object getValue()
          Gets the value assigned to this entry.
 java.util.List<java.lang.Object> getValues()
          Get values assigned to this entry.
 void mustBeDirectory()
           
 void mustExist()
           
 FileConfigurationEntry setLevel(ConfigurationEntry.Relevance level)
          override and return instance type for construction initialization
 
Methods inherited from class org.benow.java.config.entry.StringConfigurationEntry
getMappedValue, getMappedValue, getMappedValues, getStringArray, getStringValue, getStringValues
 
Methods inherited from class org.benow.java.config.ConfigurationEntryImpl
addValue, addValueQuiet, addValues, assertValueCondition, assigned, assignFrom, clear, getDeclarationLocation, getDeclaringClass, getDescription, getDisplayName, getLevel, getLocation, getMultiValues, getName, getPossibleValues, getPossibleValuesString, getRawValue, getRawValues, getRawValuesAsCSV, getRelevance, getSimpleName, getSoloValue, getType, getValidator, getValuesAsString, isDefault, isValid, reference, removeValue, resolveValuesIn, setDefaultValue, setDescription, setDisplayName, setLocation, setPossibleValues, setRawValue, setRawValues, setReferredChangeHander, setRelevance, setSoloValue, setType, setValidator, setValue, setValueAsString, setValueQuiet, setValues, setValuesAsStrings, setValuesQuiet, toCSVString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MUST_EXIST

public static final boolean MUST_EXIST
See Also:
Constant Field Values

MAY_NOT_EXIST

public static final boolean MAY_NOT_EXIST
See Also:
Constant Field Values
Constructor Detail

FileConfigurationEntry

protected FileConfigurationEntry()

FileConfigurationEntry

public FileConfigurationEntry(java.lang.String name,
                              java.io.File defaultValue,
                              boolean mustExist,
                              java.lang.String description)

FileConfigurationEntry

public FileConfigurationEntry(java.lang.String name,
                              java.lang.String defaultValue,
                              boolean mustExist,
                              java.lang.String desc)

FileConfigurationEntry

public FileConfigurationEntry(java.lang.String name,
                              java.util.List<?> defaultValue,
                              boolean mustExist,
                              java.lang.String description)

FileConfigurationEntry

public FileConfigurationEntry(java.lang.String name,
                              java.lang.String defaultValue,
                              java.lang.String description)
Use for explicit entry specification by passing Object.class as declaringClass, which allows for easy reference using only name, not prefix. ie:

new FileConfigurationEntry(Object.class,"rootDir",".","Base directory");
allows for entry:
new FileConfigurationEntry(MyClass.class,"mediaDir","{$rootDir}/media","MediaDirectorydirectory");

Parameters:
name - TODO
Method Detail

setLevel

public FileConfigurationEntry setLevel(ConfigurationEntry.Relevance level)
Description copied from class: ConfigurationEntryImpl
override and return instance type for construction initialization

Overrides:
setLevel in class StringConfigurationEntry

mustExist

public void mustExist()

assertHasValue

protected void assertHasValue()

getValue

public java.lang.Object getValue()
Description copied from interface: ConfigurationEntry
Gets the value assigned to this entry. Or, if not provided, the default value, if assigned with setDefaultValue

Specified by:
getValue in interface ConfigurationEntry
Overrides:
getValue in class ConfigurationEntryImpl
Returns:
value
See Also:
ConfigurationEntry.setDefaultValue(Object)

getValues

public java.util.List<java.lang.Object> getValues()
Description copied from interface: ConfigurationEntry
Get values assigned to this entry. If not provided, and no default value a configuration exception is generated.

Specified by:
getValues in interface ConfigurationEntry
Overrides:
getValues in class ConfigurationEntryImpl
Returns:
values

getFileValue

public java.io.File getFileValue()
                          throws ConfigurationException
Throws:
ConfigurationException

getFileValues

public java.util.List<java.io.File> getFileValues()
                                           throws ConfigurationException
Throws:
ConfigurationException

mustBeDirectory

public void mustBeDirectory()

createIfRequired

public void createIfRequired()