Smutty


Smutty.Smutty_Config

Class Smutty_Config

Smutty_Object
|
+--Smutty_Config

public class Smutty_Config
extends Smutty_Object

this class creates allows access to config files in an easy way. normally for Smutty a singleton instance is maintained (accessed through getInstance())

See Also:
getInstance()

Constructor Summary

Smutty_Config()

constructor.

Method Summary
String

get(String name)

looks for a config setting matching the given name.

static Smutty_Config

getInstance()

returns the singleton for this object

private String

getWildcardRegExp(String name)

converts a string into a regexp where wildcards (*'s) will be matched in it.

nothing

loadConfig(String path)

loads the config with data from the specified file.

nothing

loadDefaults()

this function loads the default config files

nothing

loadLine(String line)

processes a single line of configuration info

Constructor Detail

Smutty_Config

public Smutty_Config()

constructor. creates a new config class.


Method Detail

get

public String get(String name)

looks for a config setting matching the given name. you can use a "*" as a wildcard

Parameters:
name - setting name
Returns:
the config value
Go to code

getInstance

public static Smutty_Config getInstance()

returns the singleton for this object

Returns:
the singleton
Go to code

getWildcardRegExp

private String getWildcardRegExp(String name)

converts a string into a regexp where wildcards (*'s) will be matched in it.

Parameters:
name - the string to convert
Returns:
the regexp
Go to code

loadConfig

public nothing loadConfig(String path)

loads the config with data from the specified file. this will not overwrite any data, so it can be called multiple times to load data from multiple config files.

Parameters:
path - path to file to load
Go to code

loadDefaults

public nothing loadDefaults()

this function loads the default config files

Go to code

loadLine

public nothing loadLine(String line)

processes a single line of configuration info

Parameters:
line - the line to parse
Go to code

Smutty