| java.lang.Object net.myvietnam.mvncore.configuration.AbstractConfiguration net.myvietnam.mvncore.configuration.BaseConfiguration net.myvietnam.mvncore.configuration.JNDIConfiguration
JNDIConfiguration | public class JNDIConfiguration extends BaseConfiguration implements Configuration(Code) | | This Configuration class allows you to interface with a JNDI datasource.
author: Eric Pugh version: $Id: JNDIConfiguration.java,v 1.5 2007/10/16 06:54:48 lexuanttkhtn Exp $ |
Method Summary | |
public void | addProperty(String key, Object token) | public void | clearProperty(String key) Clear a property in the configuration. | public boolean | containsKey(String key) check if the configuration contains the key, or the key
has been removed. | public Boolean | getBoolean(String key, Boolean defaultValue) Get a boolean associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public Byte | getByte(String key, Byte defaultValue) Get a byte associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public Double | getDouble(String key, Double defaultValue) Get a double associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public Float | getFloat(String key, Float defaultValue) Get a float associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public Integer | getInteger(String key, Integer defaultValue) Get a int associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public Iterator | getKeys() Get the list of the keys contained in the configuration
repository. | public Iterator | getKeys(String key) Get the list of the keys contained in the configuration
repository that match a passed in beginning pattern.
Parameters: key - the key pattern to match on. | public Long | getLong(String key, Long defaultValue) Get a long associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public String | getPrefix() | public Properties | getProperties(String key) Get a list of properties associated with the given
configuration key.
Parameters: key - The configuration key. | public Object | getProperty(String key) Gets a property from the configuration.
Parameters: key - property to retrieve value as object. | public Short | getShort(String key, Short defaultValue) Get a short associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public String | getString(String key, String defaultValue) Get a string associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public String[] | getStringArray(String key) Get an array of strings associated with the given configuration
key.
Parameters: key - The configuration key. | public Vector | getVector(String key, Vector defaultValue) Get a Vector of strings associated with the given configuration key.
Typically this will be just a single item, as you can't have multiple
properties with the same name.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. | public boolean | isEmpty() | public void | setPrefix(String prefix) Sets the prefix. | public void | setProperty(String key, Object value) Set a property, this will replace any previously
set values. | public Configuration | subset(String prefix) Create an ExtendedProperties object that is a subset
of this one. |
JNDIConfiguration | public JNDIConfiguration()(Code) | | Creates an empty JNDIConfiguration object which can then
be added some other Configuration files
|
addProperty | public void addProperty(String key, Object token)(Code) | | JNDIConfigurations can not be added to
Parameters: key - The Key to add the property to. Parameters: token - The Value to add. |
clearProperty | public void clearProperty(String key)(Code) | | Clear a property in the configuration. Just marks it as cleared,
doesn't change the underlying JNDI data source.
Parameters: key - the key to remove along with corresponding value. |
containsKey | public boolean containsKey(String key)(Code) | | check if the configuration contains the key, or the key
has been removed.
|
getBoolean | public Boolean getBoolean(String key, Boolean defaultValue)(Code) | | Get a boolean associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated boolean if key is found and has validformat, default value otherwise. throws: ClassCastException - is thrown if the key maps to anobject that is not a Boolean. |
getByte | public Byte getByte(String key, Byte defaultValue)(Code) | | Get a byte associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated byte if key is found and has valid format, defaultvalue otherwise. throws: ClassCastException - is thrown if the key maps to an object thatis not a Byte. throws: NumberFormatException - is thrown if the value mapped by the keyhas not a valid number format. |
getDouble | public Double getDouble(String key, Double defaultValue)(Code) | | Get a double associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated double if key is found and has validformat, default value otherwise. throws: ClassCastException - is thrown if the key maps to anobject that is not a Double. throws: NumberFormatException - is thrown if the value mappedby the key has not a valid number format. |
getFloat | public Float getFloat(String key, Float defaultValue)(Code) | | Get a float associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated float if key is found and has validformat, default value otherwise. throws: ClassCastException - is thrown if the key maps to anobject that is not a Float. throws: NumberFormatException - is thrown if the value mappedby the key has not a valid number format. |
getInteger | public Integer getInteger(String key, Integer defaultValue)(Code) | | Get a int associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated int if key is found and has valid format, defaultvalue otherwise. throws: ClassCastException - is thrown if the key maps to an object thatis not a Integer. throws: NumberFormatException - is thrown if the value mapped by the keyhas not a valid number format. |
getKeys | public Iterator getKeys()(Code) | | Get the list of the keys contained in the configuration
repository.
An Iterator. |
getKeys | public Iterator getKeys(String key)(Code) | | Get the list of the keys contained in the configuration
repository that match a passed in beginning pattern.
Parameters: key - the key pattern to match on. An Iterator. |
getLong | public Long getLong(String key, Long defaultValue)(Code) | | Get a long associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated long if key is found and has validformat, default value otherwise. throws: ClassCastException - is thrown if the key maps to anobject that is not a Long. throws: NumberFormatException - is thrown if the value mappedby the key has not a valid number format. |
getProperty | public Object getProperty(String key)(Code) | | Gets a property from the configuration.
Parameters: key - property to retrieve value as object. Will return user value if exists,if not then default value if exists, otherwise null |
getShort | public Short getShort(String key, Short defaultValue)(Code) | | Get a short associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated short if key is found and has validformat, default value otherwise. throws: ClassCastException - is thrown if the key maps to anobject that is not a Short. throws: NumberFormatException - is thrown if the value mappedby the key has not a valid number format. |
getString | public String getString(String key, String defaultValue)(Code) | | Get a string associated with the given configuration key.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated string if key is found, default value otherwise. throws: ClassCastException - is thrown if the key maps to an object thatis not a String. |
getStringArray | public String[] getStringArray(String key)(Code) | | Get an array of strings associated with the given configuration
key.
Parameters: key - The configuration key. The associated string array if key is found. throws: ClassCastException - is thrown if the key maps to anobject that is not a String/Vector of Strings. |
getVector | public Vector getVector(String key, Vector defaultValue)(Code) | | Get a Vector of strings associated with the given configuration key.
Typically this will be just a single item, as you can't have multiple
properties with the same name.
Parameters: key - The configuration key. Parameters: defaultValue - The default value. The associated Vector. |
isEmpty | public boolean isEmpty()(Code) | | |
setPrefix | public void setPrefix(String prefix)(Code) | | Sets the prefix.
Parameters: prefix - The prefix to set |
setProperty | public void setProperty(String key, Object value)(Code) | | Set a property, this will replace any previously
set values. Set values is implicitly a call
to clearProperty(key), addProperty(key,value).
Parameters: key - Parameters: value - |
subset | public Configuration subset(String prefix)(Code) | | Create an ExtendedProperties object that is a subset
of this one. Take into account duplicate keys
by using the setProperty() in ExtendedProperties.
Parameters: prefix - |
Methods inherited from net.myvietnam.mvncore.configuration.AbstractConfiguration | public void addProperty(String key, Object token)(Code)(Java Doc) abstract protected void addPropertyDirect(String key, Object obj)(Code)(Java Doc) abstract public void clearProperty(String key)(Code)(Java Doc) abstract public boolean containsKey(String key)(Code)(Java Doc) public boolean getBoolean(String key)(Code)(Java Doc) public boolean getBoolean(String key, boolean defaultValue)(Code)(Java Doc) public Boolean getBoolean(String key, Boolean defaultValue)(Code)(Java Doc) public byte getByte(String key)(Code)(Java Doc) public byte getByte(String key, byte defaultValue)(Code)(Java Doc) public Byte getByte(String key, Byte defaultValue)(Code)(Java Doc) public double getDouble(String key)(Code)(Java Doc) public double getDouble(String key, double defaultValue)(Code)(Java Doc) public Double getDouble(String key, Double defaultValue)(Code)(Java Doc) public float getFloat(String key)(Code)(Java Doc) public float getFloat(String key, float defaultValue)(Code)(Java Doc) public Float getFloat(String key, Float defaultValue)(Code)(Java Doc) public int getInt(String key)(Code)(Java Doc) public int getInt(String key, int defaultValue)(Code)(Java Doc) public Integer getInteger(String key, Integer defaultValue)(Code)(Java Doc) abstract public Iterator getKeys()(Code)(Java Doc) public Iterator getKeys(String prefix)(Code)(Java Doc) public long getLong(String key)(Code)(Java Doc) public long getLong(String key, long defaultValue)(Code)(Java Doc) public Long getLong(String key, Long defaultValue)(Code)(Java Doc) public Properties getProperties(String key)(Code)(Java Doc) public Properties getProperties(String key, Properties defaults)(Code)(Java Doc) public Object getProperty(String key)(Code)(Java Doc) abstract protected Object getPropertyDirect(String key)(Code)(Java Doc) public short getShort(String key)(Code)(Java Doc) public short getShort(String key, short defaultValue)(Code)(Java Doc) public Short getShort(String key, Short defaultValue)(Code)(Java Doc) public String getString(String key)(Code)(Java Doc) public String getString(String key, String defaultValue)(Code)(Java Doc) public String[] getStringArray(String key)(Code)(Java Doc) public Vector getVector(String key)(Code)(Java Doc) public Vector getVector(String key, Vector defaultValue)(Code)(Java Doc) protected String interpolate(String base)(Code)(Java Doc) protected String interpolateHelper(String base, List priorVariables)(Code)(Java Doc) abstract public boolean isEmpty()(Code)(Java Doc) protected List processString(String token)(Code)(Java Doc) public void setProperty(String key, Object value)(Code)(Java Doc) public Configuration subset(String prefix)(Code)(Java Doc) final protected Boolean testBoolean(String value)(Code)(Java Doc)
|
|
|