|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.configuration.event.EventSource
org.apache.commons.configuration.AbstractConfiguration
org.apache.commons.configuration.BaseConfiguration
org.apache.commons.configuration.AbstractFileConfiguration
org.apache.commons.configuration.PropertiesConfiguration
it.unimi.dsi.mg4j.util.Properties
dsiutils
.
@Deprecated public class Properties
An extension of PropertiesConfiguration
providing setters for primitive types, a simpler way to save preferences
and transparently handling of Enum
lowercased keys.
All accessors defined in PropertiesConfiguration
have a
polymorphic counterpart taking an Enum
instead of a string: Enum.name()
and String.toLowerCase()
are applied before
delegating to the corresponding string-based method. (This apparently wierd choice is due to the need to
accommodate the upper-case standard for Enum
elements and the lower-case standard
for property keys.)
Additionally, instances of this class can be serialised.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.commons.configuration.PropertiesConfiguration |
---|
PropertiesConfiguration.PropertiesReader, PropertiesConfiguration.PropertiesWriter |
Field Summary |
---|
Fields inherited from class org.apache.commons.configuration.AbstractFileConfiguration |
---|
autoSave, basePath, EVENT_RELOAD, fileName, strategy |
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
---|
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKEN |
Constructor Summary | |
---|---|
Properties()
Deprecated. |
|
Properties(File file)
Deprecated. |
|
Properties(String filename)
Deprecated. |
|
Properties(URL url)
Deprecated. |
Method Summary | |
---|---|
void |
addAll(Configuration configuration)
Deprecated. Adds all properties from the given configuration. |
void |
addProperties(Enum<?> key,
String[] s)
Deprecated. |
void |
addProperties(String key,
String[] s)
Deprecated. |
void |
addProperty(Enum<?> key,
boolean b)
Deprecated. |
void |
addProperty(Enum<?> key,
byte b)
Deprecated. |
void |
addProperty(Enum<?> key,
char c)
Deprecated. |
void |
addProperty(Enum<?> key,
double d)
Deprecated. |
void |
addProperty(Enum<?> key,
float f)
Deprecated. |
void |
addProperty(Enum<?> key,
int i)
Deprecated. |
void |
addProperty(Enum<?> key,
long l)
Deprecated. |
void |
addProperty(Enum<?> key,
Object arg)
Deprecated. |
void |
addProperty(Enum<?> key,
short s)
Deprecated. |
void |
addProperty(String key,
boolean b)
Deprecated. |
void |
addProperty(String key,
byte b)
Deprecated. |
void |
addProperty(String key,
char c)
Deprecated. |
void |
addProperty(String key,
double d)
Deprecated. |
void |
addProperty(String key,
float f)
Deprecated. |
void |
addProperty(String key,
int i)
Deprecated. |
void |
addProperty(String key,
long l)
Deprecated. |
void |
addProperty(String key,
short s)
Deprecated. |
boolean |
containsKey(Enum<?> key)
Deprecated. |
boolean |
equals(Object o)
Deprecated. Returns true if the provided object is equal to this set of properties. |
BigDecimal |
getBigDecimal(Enum<?> key)
Deprecated. |
BigDecimal |
getBigDecimal(Enum<?> key,
BigDecimal arg)
Deprecated. |
BigInteger |
getBigInteger(Enum<?> key)
Deprecated. |
BigInteger |
getBigInteger(Enum<?> key,
BigInteger arg)
Deprecated. |
boolean |
getBoolean(Enum<?> key)
Deprecated. |
boolean |
getBoolean(Enum<?> key,
boolean arg)
Deprecated. |
Boolean |
getBoolean(Enum<?> key,
Boolean arg)
Deprecated. |
byte |
getByte(Enum<?> key)
Deprecated. |
byte |
getByte(Enum<?> key,
byte arg)
Deprecated. |
Byte |
getByte(Enum<?> key,
Byte arg)
Deprecated. |
double |
getDouble(Enum<?> key)
Deprecated. |
double |
getDouble(Enum<?> key,
double arg)
Deprecated. |
Double |
getDouble(Enum<?> key,
Double arg)
Deprecated. |
float |
getFloat(Enum<?> key)
Deprecated. |
float |
getFloat(Enum<?> key,
float arg)
Deprecated. |
Float |
getFloat(Enum<?> key,
Float arg)
Deprecated. |
int |
getInt(Enum<?> key)
Deprecated. |
int |
getInt(Enum<?> key,
int arg)
Deprecated. |
Integer |
getInteger(Enum<?> key,
Integer arg)
Deprecated. |
Iterator<?> |
getKeys(Enum<?> key)
Deprecated. |
List<?> |
getList(Enum<?> key)
Deprecated. |
List<?> |
getList(Enum<?> key,
List<?> arg)
Deprecated. |
long |
getLong(Enum<?> key)
Deprecated. |
long |
getLong(Enum<?> key,
long arg)
Deprecated. |
Long |
getLong(Enum<?> key,
Long arg)
Deprecated. |
Properties |
getProperties(Enum<?> key)
Deprecated. |
Properties |
getProperties(Enum<?> key,
Properties arg)
Deprecated. |
Object |
getProperty(Enum<?> key)
Deprecated. |
short |
getShort(Enum<?> key)
Deprecated. |
short |
getShort(Enum<?> key,
short arg)
Deprecated. |
Short |
getShort(Enum<?> key,
Short arg)
Deprecated. |
String |
getString(Enum<?> key)
Deprecated. |
String |
getString(Enum<?> key,
String arg)
Deprecated. |
String[] |
getStringArray(Enum<?> key)
Deprecated. |
int |
hashCode()
Deprecated. |
void |
save(CharSequence filename)
Deprecated. Saves the configuration to the specified file. |
void |
setProperty(Enum<?> key,
boolean b)
Deprecated. |
void |
setProperty(Enum<?> key,
byte b)
Deprecated. |
void |
setProperty(Enum<?> key,
char b)
Deprecated. |
void |
setProperty(Enum<?> key,
double d)
Deprecated. |
void |
setProperty(Enum<?> key,
float f)
Deprecated. |
void |
setProperty(Enum<?> key,
int i)
Deprecated. |
void |
setProperty(Enum<?> key,
long l)
Deprecated. |
void |
setProperty(Enum<?> key,
Object arg)
Deprecated. |
void |
setProperty(Enum<?> key,
short s)
Deprecated. |
void |
setProperty(String key,
boolean b)
Deprecated. |
void |
setProperty(String key,
byte b)
Deprecated. |
void |
setProperty(String key,
char b)
Deprecated. |
void |
setProperty(String key,
double d)
Deprecated. |
void |
setProperty(String key,
float f)
Deprecated. |
void |
setProperty(String key,
int i)
Deprecated. |
void |
setProperty(String key,
long l)
Deprecated. |
void |
setProperty(String key,
short s)
Deprecated. |
Configuration |
subset(Enum<?> key)
Deprecated. |
String |
toString()
Deprecated. |
Methods inherited from class org.apache.commons.configuration.PropertiesConfiguration |
---|
clone, createLayout, getHeader, getInclude, getIncludesAllowed, getLayout, load, save, setBasePath, setHeader, setInclude, setIncludesAllowed, setLayout, unescapeJava |
Methods inherited from class org.apache.commons.configuration.AbstractFileConfiguration |
---|
addProperty, clearProperty, containsKey, enterNoReload, exitNoReload, fireEvent, getBasePath, getEncoding, getFile, getFileName, getKeys, getPath, getProperty, getReloadingStrategy, getURL, isAutoSave, isEmpty, load, load, load, load, load, load, possiblySave, reload, save, save, save, save, save, save, setAutoSave, setEncoding, setFile, setFileName, setPath, setProperty, setReloadingStrategy, setURL |
Methods inherited from class org.apache.commons.configuration.BaseConfiguration |
---|
addPropertyDirect, clear, clearPropertyDirect |
Methods inherited from class org.apache.commons.configuration.event.EventSource |
---|
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.commons.configuration.Configuration |
---|
clear, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, subset |
Constructor Detail |
---|
public Properties()
public Properties(String filename) throws ConfigurationException
ConfigurationException
public Properties(File file) throws ConfigurationException
ConfigurationException
public Properties(URL url) throws ConfigurationException
ConfigurationException
Method Detail |
---|
public void save(CharSequence filename) throws ConfigurationException, IOException
filename
- a file name.
ConfigurationException
IOException
public void addAll(Configuration configuration)
Properties from the new configuration will clear properties from the first one.
configuration
- a configuration.public void addProperties(String key, String[] s)
public void addProperty(String key, boolean b)
public void setProperty(String key, boolean b)
public void addProperty(String key, byte b)
public void setProperty(String key, byte b)
public void addProperty(String key, short s)
public void setProperty(String key, short s)
public void addProperty(String key, char c)
public void setProperty(String key, char b)
public void addProperty(String key, int i)
public void setProperty(String key, int i)
public void addProperty(String key, long l)
public void setProperty(String key, long l)
public void addProperty(String key, float f)
public void setProperty(String key, float f)
public void addProperty(String key, double d)
public void setProperty(String key, double d)
public void addProperties(Enum<?> key, String[] s)
public void addProperty(Enum<?> key, boolean b)
public void setProperty(Enum<?> key, boolean b)
public void addProperty(Enum<?> key, byte b)
public void setProperty(Enum<?> key, byte b)
public void addProperty(Enum<?> key, short s)
public void setProperty(Enum<?> key, short s)
public void addProperty(Enum<?> key, char c)
public void setProperty(Enum<?> key, char b)
public void addProperty(Enum<?> key, int i)
public void setProperty(Enum<?> key, int i)
public void addProperty(Enum<?> key, long l)
public void setProperty(Enum<?> key, long l)
public void addProperty(Enum<?> key, float f)
public void setProperty(Enum<?> key, float f)
public void addProperty(Enum<?> key, double d)
public void setProperty(Enum<?> key, double d)
public boolean containsKey(Enum<?> key)
public Object getProperty(Enum<?> key)
public void addProperty(Enum<?> key, Object arg)
public BigDecimal getBigDecimal(Enum<?> key, BigDecimal arg)
public BigDecimal getBigDecimal(Enum<?> key)
public BigInteger getBigInteger(Enum<?> key, BigInteger arg)
public BigInteger getBigInteger(Enum<?> key)
public boolean getBoolean(Enum<?> key, boolean arg)
public Boolean getBoolean(Enum<?> key, Boolean arg)
public boolean getBoolean(Enum<?> key)
public byte getByte(Enum<?> key, byte arg)
public Byte getByte(Enum<?> key, Byte arg)
public byte getByte(Enum<?> key)
public double getDouble(Enum<?> key, double arg)
public Double getDouble(Enum<?> key, Double arg)
public double getDouble(Enum<?> key)
public float getFloat(Enum<?> key, float arg)
public Float getFloat(Enum<?> key, Float arg)
public float getFloat(Enum<?> key)
public int getInt(Enum<?> key, int arg)
public int getInt(Enum<?> key)
public Integer getInteger(Enum<?> key, Integer arg)
public Iterator<?> getKeys(Enum<?> key)
public List<?> getList(Enum<?> key, List<?> arg)
public List<?> getList(Enum<?> key)
public long getLong(Enum<?> key, long arg)
public Long getLong(Enum<?> key, Long arg)
public long getLong(Enum<?> key)
public Properties getProperties(Enum<?> key, Properties arg)
public Properties getProperties(Enum<?> key)
public short getShort(Enum<?> key, short arg)
public Short getShort(Enum<?> key, Short arg)
public short getShort(Enum<?> key)
public String getString(Enum<?> key, String arg)
public String getString(Enum<?> key)
public String[] getStringArray(Enum<?> key)
public void setProperty(Enum<?> key, Object arg)
public Configuration subset(Enum<?> key)
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
Equality between set of properties happens when the keys are the same, and the list of strings associated to each key is the same. Note that the order in which different keys appear in a property file is irrelevant, but the order between properties with the same key is significant.
Due to the strictness of the check (e.g., no number conversion is performed) this method is mainly useful when writing tests.
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |