com.uwyn.rife.config
Class Config

java.lang.Object
  extended by com.uwyn.rife.config.Config
All Implemented Interfaces:
Cloneable

public class Config
extends Object
implements Cloneable


Field Summary
static String DEFAULT_PARTICIPANT_NAME
           
static String PARAMETER_PREFERENCES_SYSTEM
           
static String PARAMETER_PREFERENCES_USER
           
 
Constructor Summary
Config()
           
Config(String configSource, ResourceFinder resourceFinder)
           
 
Method Summary
 void addListItem(String list, boolean item)
           
 void addListItem(String list, char item)
           
 void addListItem(String list, double item)
           
 void addListItem(String list, float item)
           
 void addListItem(String list, int item)
           
 void addListItem(String list, long item)
           
 void addListItem(String list, Serializable item)
           
 void addListItem(String list, String item)
           
 void clearList(String list)
           
 Config clone()
           
 int countLists()
           
 int countParameters()
           
 boolean getBool(String parameter)
           
 boolean getBool(String parameter, boolean defaultValue)
           
 Collection<Boolean> getBoolItems(String list)
           
 int getChar(String parameter)
           
 int getChar(String parameter, char defaultValue)
           
 Collection<Character> getCharItems(String list)
           
 double getDouble(String parameter)
           
 double getDouble(String parameter, double defaultValue)
           
 Collection<Double> getDoubleItems(String list)
           
 float getFloat(String parameter)
           
 float getFloat(String parameter, float defaultValue)
           
 Collection<Float> getFloatItems(String list)
           
 int getInt(String parameter)
           
 int getInt(String parameter, int defaultValue)
           
 Collection<Integer> getIntItems(String list)
           
 long getLong(String parameter)
           
 long getLong(String parameter, long defaultValue)
           
 Collection<Long> getLongItems(String list)
           
 Preferences getPreferencesNode()
           
static Config getRepInstance()
           
<TargetType extends Serializable>
TargetType
getSerializable(String parameter)
           
<TargetType extends Serializable>
TargetType
getSerializable(String parameter, TargetType defaultValue)
           
<TargetType extends Serializable>
Collection<TargetType>
getSerializableItems(String list)
           
 String getString(String parameter)
           
 String getString(String parameter, String defaultValue)
           
 Collection<String> getStringItems(String list)
           
 String getXmlPath()
           
 boolean hasList(String list)
           
 boolean hasParameter(String parameter)
           
 boolean hasPreferencesNode()
           
static boolean hasRepInstance()
           
 boolean isFinalList(String list)
           
 boolean isFinalParameter(String parameter)
           
 void removeList(String list)
           
 void removeParameter(String parameter)
           
 void setFinalList(String list, boolean isFinal)
           
 void setFinalParameter(String parameter, boolean isFinal)
           
 void setParameter(String parameter, boolean value)
           
 void setParameter(String parameter, char value)
           
 void setParameter(String parameter, double value)
           
 void setParameter(String parameter, float value)
           
 void setParameter(String parameter, int value)
           
 void setParameter(String parameter, long value)
           
 void setParameter(String parameter, Serializable value)
           
 void setParameter(String parameter, String value)
           
 void setPreferencesNode(Preferences node)
           
 void storeToPreferences()
           
 void storeToPreferences(Preferences preferences)
           
 void storeToXml()
           
 void storeToXml(File destination)
           
 String toXml()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARTICIPANT_NAME

public static final String DEFAULT_PARTICIPANT_NAME
See Also:
Constant Field Values

PARAMETER_PREFERENCES_USER

public static final String PARAMETER_PREFERENCES_USER
See Also:
Constant Field Values

PARAMETER_PREFERENCES_SYSTEM

public static final String PARAMETER_PREFERENCES_SYSTEM
See Also:
Constant Field Values
Constructor Detail

Config

public Config()

Config

public Config(String configSource,
              ResourceFinder resourceFinder)
       throws ConfigErrorException
Throws:
ConfigErrorException
Method Detail

getXmlPath

public String getXmlPath()

setPreferencesNode

public void setPreferencesNode(Preferences node)

hasPreferencesNode

public boolean hasPreferencesNode()

getPreferencesNode

public Preferences getPreferencesNode()

hasRepInstance

public static boolean hasRepInstance()

getRepInstance

public static Config getRepInstance()

hasParameter

public boolean hasParameter(String parameter)

isFinalParameter

public boolean isFinalParameter(String parameter)

countParameters

public int countParameters()

getString

public String getString(String parameter)

getString

public String getString(String parameter,
                        String defaultValue)

getBool

public boolean getBool(String parameter)

getBool

public boolean getBool(String parameter,
                       boolean defaultValue)

getChar

public int getChar(String parameter)

getChar

public int getChar(String parameter,
                   char defaultValue)

getInt

public int getInt(String parameter)

getInt

public int getInt(String parameter,
                  int defaultValue)

getLong

public long getLong(String parameter)

getLong

public long getLong(String parameter,
                    long defaultValue)

getFloat

public float getFloat(String parameter)

getFloat

public float getFloat(String parameter,
                      float defaultValue)

getDouble

public double getDouble(String parameter)

getDouble

public double getDouble(String parameter,
                        double defaultValue)

getSerializable

public <TargetType extends Serializable> TargetType getSerializable(String parameter)

getSerializable

public <TargetType extends Serializable> TargetType getSerializable(String parameter,
                                                                    TargetType defaultValue)

setFinalParameter

public void setFinalParameter(String parameter,
                              boolean isFinal)

setParameter

public void setParameter(String parameter,
                         String value)

setParameter

public void setParameter(String parameter,
                         boolean value)

setParameter

public void setParameter(String parameter,
                         char value)

setParameter

public void setParameter(String parameter,
                         int value)

setParameter

public void setParameter(String parameter,
                         long value)

setParameter

public void setParameter(String parameter,
                         float value)

setParameter

public void setParameter(String parameter,
                         double value)

setParameter

public void setParameter(String parameter,
                         Serializable value)
                  throws ConfigErrorException
Throws:
ConfigErrorException

removeParameter

public void removeParameter(String parameter)

isFinalList

public boolean isFinalList(String list)

getStringItems

public Collection<String> getStringItems(String list)

getBoolItems

public Collection<Boolean> getBoolItems(String list)

getCharItems

public Collection<Character> getCharItems(String list)

getIntItems

public Collection<Integer> getIntItems(String list)

getLongItems

public Collection<Long> getLongItems(String list)

getFloatItems

public Collection<Float> getFloatItems(String list)

getDoubleItems

public Collection<Double> getDoubleItems(String list)

getSerializableItems

public <TargetType extends Serializable> Collection<TargetType> getSerializableItems(String list)

hasList

public boolean hasList(String list)

countLists

public int countLists()

addListItem

public void addListItem(String list,
                        String item)

addListItem

public void addListItem(String list,
                        boolean item)

addListItem

public void addListItem(String list,
                        char item)

addListItem

public void addListItem(String list,
                        int item)

addListItem

public void addListItem(String list,
                        long item)

addListItem

public void addListItem(String list,
                        float item)

addListItem

public void addListItem(String list,
                        double item)

addListItem

public void addListItem(String list,
                        Serializable item)
                 throws ConfigErrorException
Throws:
ConfigErrorException

clearList

public void clearList(String list)

removeList

public void removeList(String list)

setFinalList

public void setFinalList(String list,
                         boolean isFinal)

toXml

public String toXml()

storeToXml

public void storeToXml()
                throws ConfigErrorException
Throws:
ConfigErrorException

storeToXml

public void storeToXml(File destination)
                throws ConfigErrorException
Throws:
ConfigErrorException

storeToPreferences

public void storeToPreferences()
                        throws ConfigErrorException
Throws:
ConfigErrorException

storeToPreferences

public void storeToPreferences(Preferences preferences)
                        throws ConfigErrorException
Throws:
ConfigErrorException

clone

public Config clone()
Overrides:
clone in class Object


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.