org.compass.core.config
Class RuntimeCompassSettings

java.lang.Object
  extended by org.compass.core.config.CompassSettings
      extended by org.compass.core.config.RuntimeCompassSettings

public class RuntimeCompassSettings
extends CompassSettings

Runtime settings for Compass applies on the Session level. Reading settings is first perfomed against the runtime settings set, and then the global settings. Writing settings will only apply on the runtime settings and not affect the global settings.

Author:
kimchy

Constructor Summary
RuntimeCompassSettings(CompassSettings globalSettings)
           
 
Method Summary
 void addSettings(CompassSettings settings)
           
 void addSettings(Map<String,Object> settings)
           
 void addSettings(Properties settings)
           
 CompassSettings copy()
           
 Object getRegistry(Object key)
          ADANCE: An internal compass global registry
 String getSetting(String setting)
           
 String getSetting(String setting, String defaultValue)
           
 boolean getSettingAsBoolean(String setting, boolean defaultValue)
           
 Class getSettingAsClass(String setting, Class clazz)
           
 Class getSettingAsClass(String setting, Class clazz, ClassLoader classLoader)
           
 double getSettingAsDouble(String setting, double defaultValue)
           
 float getSettingAsFloat(String setting, float defaultValue)
           
 Object getSettingAsInstance(String setting, String defaultClass)
           
 int getSettingAsInt(String setting, int defaultValue)
           
 long getSettingAsLong(String setting, long defaultValue)
           
 Object getSettingAsObject(String setting)
           
 Map<String,CompassSettings> getSettingGroups(String settingPrefix)
           
 Object removeRegistry(Object key)
          ADVANCE: An internal compass global registry
 CompassSettings setBooleanSetting(String setting, boolean value)
           
 CompassSettings setClassSetting(String setting, Class clazz)
           
 CompassSettings setDoubleSetting(String setting, double value)
           
 CompassSettings setFloatSetting(String setting, float value)
           
 CompassSettings setGroupSettings(String settingPrefix, String groupName, String[] settings, Object[] values)
          Sets a group of settings, sharing the same setting prefix.
 CompassSettings setIntSetting(String setting, int value)
           
 CompassSettings setLongSetting(String setting, long value)
           
 CompassSettings setObjectSetting(String setting, Object value)
           
 void setRegistry(Object key, Object value)
          ADVANCE: An internal compass global registry
 CompassSettings setSetting(String setting, String value)
           
 String toString()
           
 
Methods inherited from class org.compass.core.config.CompassSettings
clear, getClassLoader, getDirectClassLoader, getProperties, getSettingAsInstance, getUnderlyingMap, keySet, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuntimeCompassSettings

public RuntimeCompassSettings(CompassSettings globalSettings)
Method Detail

addSettings

public void addSettings(Properties settings)
Overrides:
addSettings in class CompassSettings

addSettings

public void addSettings(Map<String,Object> settings)
Overrides:
addSettings in class CompassSettings

addSettings

public void addSettings(CompassSettings settings)
Overrides:
addSettings in class CompassSettings

copy

public CompassSettings copy()
Overrides:
copy in class CompassSettings

getSetting

public String getSetting(String setting)
Overrides:
getSetting in class CompassSettings

getSettingAsObject

public Object getSettingAsObject(String setting)
Overrides:
getSettingAsObject in class CompassSettings

getSetting

public String getSetting(String setting,
                         String defaultValue)
Overrides:
getSetting in class CompassSettings

getSettingGroups

public Map<String,CompassSettings> getSettingGroups(String settingPrefix)
Overrides:
getSettingGroups in class CompassSettings

getSettingAsFloat

public float getSettingAsFloat(String setting,
                               float defaultValue)
Overrides:
getSettingAsFloat in class CompassSettings

getSettingAsInt

public int getSettingAsInt(String setting,
                           int defaultValue)
Overrides:
getSettingAsInt in class CompassSettings

getSettingAsLong

public long getSettingAsLong(String setting,
                             long defaultValue)
Overrides:
getSettingAsLong in class CompassSettings

getSettingAsBoolean

public boolean getSettingAsBoolean(String setting,
                                   boolean defaultValue)
Overrides:
getSettingAsBoolean in class CompassSettings

getSettingAsDouble

public double getSettingAsDouble(String setting,
                                 double defaultValue)
Overrides:
getSettingAsDouble in class CompassSettings

getSettingAsClass

public Class getSettingAsClass(String setting,
                               Class clazz)
                        throws ClassNotFoundException
Overrides:
getSettingAsClass in class CompassSettings
Throws:
ClassNotFoundException

getSettingAsClass

public Class getSettingAsClass(String setting,
                               Class clazz,
                               ClassLoader classLoader)
                        throws ClassNotFoundException
Overrides:
getSettingAsClass in class CompassSettings
Throws:
ClassNotFoundException

getSettingAsInstance

public Object getSettingAsInstance(String setting,
                                   String defaultClass)
Overrides:
getSettingAsInstance in class CompassSettings

setSetting

public CompassSettings setSetting(String setting,
                                  String value)
Overrides:
setSetting in class CompassSettings

setObjectSetting

public CompassSettings setObjectSetting(String setting,
                                        Object value)
Overrides:
setObjectSetting in class CompassSettings

setBooleanSetting

public CompassSettings setBooleanSetting(String setting,
                                         boolean value)
Overrides:
setBooleanSetting in class CompassSettings

setFloatSetting

public CompassSettings setFloatSetting(String setting,
                                       float value)
Overrides:
setFloatSetting in class CompassSettings

setIntSetting

public CompassSettings setIntSetting(String setting,
                                     int value)
Overrides:
setIntSetting in class CompassSettings

setLongSetting

public CompassSettings setLongSetting(String setting,
                                      long value)
Overrides:
setLongSetting in class CompassSettings

setDoubleSetting

public CompassSettings setDoubleSetting(String setting,
                                        double value)
Overrides:
setDoubleSetting in class CompassSettings

setClassSetting

public CompassSettings setClassSetting(String setting,
                                       Class clazz)
Overrides:
setClassSetting in class CompassSettings

setGroupSettings

public CompassSettings setGroupSettings(String settingPrefix,
                                        String groupName,
                                        String[] settings,
                                        Object[] values)
Description copied from class: CompassSettings
Sets a group of settings, sharing the same setting prefix. The provided settings are appended to the settingPrefix, and the matching values are set.

The constructed setting is: settingPrefix + "." + groupName + "." + settings[i].

Overrides:
setGroupSettings in class CompassSettings
Parameters:
settingPrefix - The prefix used for all settings
groupName - The name of the setting group
settings - The settings name appended to settingsPrefix + "." + groupName + "."
values - The values of the settings matched against the settings parameters
Returns:
This settings instance for method chaining

getRegistry

public Object getRegistry(Object key)
Description copied from class: CompassSettings
ADANCE: An internal compass global registry

Overrides:
getRegistry in class CompassSettings

setRegistry

public void setRegistry(Object key,
                        Object value)
Description copied from class: CompassSettings
ADVANCE: An internal compass global registry

Overrides:
setRegistry in class CompassSettings

removeRegistry

public Object removeRegistry(Object key)
Description copied from class: CompassSettings
ADVANCE: An internal compass global registry

Overrides:
removeRegistry in class CompassSettings

toString

public String toString()
Overrides:
toString in class CompassSettings


Copyright (c) 2004-2008 The Compass Project.