|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.mmbase.util.ExtendedProperties
public class ExtendedProperties
This is a flexible Properties version, it can handle saving of Properties with the comments that will stay in your file.
| Field Summary | |
|---|---|
protected String |
commentPrefix
The prefix of the comment in the Properties file. |
| Fields inherited from class java.util.Properties |
|---|
defaults |
| Constructor Summary | |
|---|---|
ExtendedProperties()
Extended Properties constructor |
|
ExtendedProperties(ExtendedProperties exProp)
Create an ExtendedProperties with a Allready filled ExtendedProperty list. |
|
ExtendedProperties(String filename)
Create and read an ExtendedProperty from file. |
|
| Method Summary | |
|---|---|
Vector<String> |
getPropertyValues(String whichProp,
String delimeter)
return a Vector of Strings which is parsed from a specified Property. |
void |
getProps(String filename)
Read to this Property, the Properties from a file. |
void |
load(InputStream in)
Loads properties from an InputStream. |
Hashtable<Object,Object> |
readProperties(String filename)
Read from Properties and return them. |
String |
save()
|
void |
save(String filename)
This routine does not only saves your Properties but also merges your comments if the file already exists if the file doesn't exists the will call the "normal" write routine. |
void |
saveProperties(String filename,
Hashtable<Object,Object> propsToSave)
save Properties to file. |
Object |
setProperty(String name,
String value)
Set the Property. |
void |
showContents()
Dump the contents of this Property to your screen (for debugging) |
| Methods inherited from class java.util.Properties |
|---|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String commentPrefix
| Constructor Detail |
|---|
public ExtendedProperties()
public ExtendedProperties(String filename)
filename - The file from were to read.public ExtendedProperties(ExtendedProperties exProp)
exProp - The list that will be put in this ExtendedProperty.| Method Detail |
|---|
public Hashtable<Object,Object> readProperties(String filename)
filename - The file from were to read the Properties.
public void saveProperties(String filename,
Hashtable<Object,Object> propsToSave)
filename - The File were to save thempropsToSave - The Properties which to save.
public Vector<String> getPropertyValues(String whichProp,
String delimeter)
whichProp - The Property to get the list from.delimeter - The delimeter to split wichProp's value with.
public void getProps(String filename)
throws IOException
filename - The file were to read from
IOException
public void load(InputStream in)
throws IOException
load in class Propertiesin - the input stream
IOException - Error when reading from input stream.
public void save(String filename)
throws IOException
filename - The file were to save to.
IOException
public Object setProperty(String name,
String value)
setProperty in class Propertiesname - the name of the Property (the part in front of the '=' in the Property file)value - the (new) value of the Property (the part after the '=' in the Property file)public void showContents()
public String save()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||