com.almende.eve.config
Class Config

java.lang.Object
  extended by com.almende.eve.config.Config

public class Config
extends Object


Constructor Summary
Config()
           
Config(InputStream inputStream)
          Load the configuration file from input stream
Config(Map<String,Object> config)
          Load the configuration from a map
Config(String filename)
          Load the configuration file by filename (absolute path) Default filename is /WEB-INF/eve.yaml
 
Method Summary
 Map<String,Object> get()
          Get the full configuration returns null if no configuration file is loaded
<T> T
get(String... params)
          retrieve a (nested) parameter from the config the parameter name can be a simple name like config.get("url"), or nested parameter like config.get("servlet", "config", "url") null is returned when the parameter is not found, or when no configuration file is loaded.
 void load(InputStream inputStream)
          Load the configuration file from input stream
 void load(String filename)
          Load the configuration file by filename (absolute path) Default filename is /WEB-INF/eve.yaml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config

public Config()

Config

public Config(String filename)
       throws FileNotFoundException
Load the configuration file by filename (absolute path) Default filename is /WEB-INF/eve.yaml

Parameters:
filename -
Throws:
FileNotFoundException

Config

public Config(InputStream inputStream)
Load the configuration file from input stream

Parameters:
filename -
Throws:
FileNotFoundException

Config

public Config(Map<String,Object> config)
Load the configuration from a map

Parameters:
map -
Method Detail

load

public void load(String filename)
          throws FileNotFoundException
Load the configuration file by filename (absolute path) Default filename is /WEB-INF/eve.yaml

Parameters:
filename -
Throws:
FileNotFoundException

load

public void load(InputStream inputStream)
Load the configuration file from input stream

Parameters:
filename -
Throws:
FileNotFoundException

get

public Map<String,Object> get()
Get the full configuration returns null if no configuration file is loaded

Returns:

get

public <T> T get(String... params)
retrieve a (nested) parameter from the config the parameter name can be a simple name like config.get("url"), or nested parameter like config.get("servlet", "config", "url") null is returned when the parameter is not found, or when no configuration file is loaded.

Parameters:
params - One or multiple (nested) parameters
Returns:


Copyright © 2013 Almende BV. All Rights Reserved.