net.sf.magicproject.tools
Class Configuration

java.lang.Object
  extended by net.sf.magicproject.tools.Configuration

public final class Configuration
extends java.lang.Object

Since:
0.93
Author:
Fabrice Daugan

Method Summary
static void addRecentProperty(java.lang.String property, java.lang.String pItem)
          Add a property to the list.
static java.lang.String[] getArray(java.lang.String property)
           
static java.lang.Boolean getBoolean(java.lang.String property)
           
static java.lang.Boolean getBoolean(java.lang.String property, java.lang.Boolean defaultValue)
           
static org.apache.commons.configuration.XMLConfiguration getConfiguration()
          Return the configuration node.
static float getFloat(java.lang.String property, java.lang.Float defaultValue)
           
static java.lang.Integer getInt(java.lang.String property)
           
static java.lang.Integer getInt(java.lang.String property, java.lang.Integer defaultValue)
           
static java.lang.String getString(java.lang.String property)
           
static java.lang.String getString(java.lang.String property, java.lang.String defaultValue)
           
static java.io.File loadTemplateFile(java.lang.String userFile)
          Load the given userFile file.
static java.io.File loadTemplateTbsFile(java.lang.String userFile)
          Load the given userFile file.
static void setProperty(java.lang.String property, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public static java.lang.String getString(java.lang.String property)
Parameters:
property -
Returns:
the string value if it exists, empty string otherwise.

getArray

public static java.lang.String[] getArray(java.lang.String property)
Parameters:
property -
Returns:
the string value if it exists, empty string otherwise.

addRecentProperty

public static void addRecentProperty(java.lang.String property,
                                     java.lang.String pItem)
Add a property to the list.

Parameters:
property -
pItem -

getString

public static java.lang.String getString(java.lang.String property,
                                         java.lang.String defaultValue)
Parameters:
property -
defaultValue -
Returns:
the string value if it exists, defaultValue otherwise.

getBoolean

public static java.lang.Boolean getBoolean(java.lang.String property,
                                           java.lang.Boolean defaultValue)
Parameters:
property -
defaultValue -
Returns:
the boolean value if it exists, defaultValue otherwise.

getBoolean

public static java.lang.Boolean getBoolean(java.lang.String property)
Parameters:
property -
Returns:
the boolean value if it exists, null otherwise.

getInt

public static java.lang.Integer getInt(java.lang.String property,
                                       java.lang.Integer defaultValue)
Parameters:
property -
defaultValue -
Returns:
the integer value if it exists, defaultValue otherwise.

getInt

public static java.lang.Integer getInt(java.lang.String property)
Parameters:
property -
Returns:
the integer value if it exists, 0 otherwise.

setProperty

public static void setProperty(java.lang.String property,
                               java.lang.Object value)
Parameters:
property -
value -

getFloat

public static float getFloat(java.lang.String property,
                             java.lang.Float defaultValue)
Parameters:
property -
defaultValue -
Returns:
the float value if it exists, defaultValue otherwise.

getConfiguration

public static org.apache.commons.configuration.XMLConfiguration getConfiguration()
Return the configuration node.

Returns:
the configuration node.

loadTemplateFile

public static java.io.File loadTemplateFile(java.lang.String userFile)
Load the given userFile file. If is not found, try to load the default file.

Parameters:
userFile - the configuration file.
Returns:
the user configuration.

loadTemplateTbsFile

public static java.io.File loadTemplateTbsFile(java.lang.String userFile)
Load the given userFile file. If is not found, try to load the default file.

Parameters:
userFile - the configuration file.
Returns:
the user configuration.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.