|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.util.PropertiesBean
public abstract class PropertiesBean
A "java bean" that can serialize itself into a java.util.Properties instance. For the serialization, the class uses the java beans instrospection mechanism to figure out the class's available properties, and saves all the properties as strings in the properties object.
Properties are saved based on a "root", which is set up during the
instantiation of the object. The properties will be set as
root.property_name
.
Only native types (boolean, char, double, float, int, long, short), Strings, and arrays of those types are supported. Also, nested beans are not supported presently.
Constructor Summary | |
---|---|
protected |
PropertiesBean(java.lang.String root)
Creates a new instance with the given root and the default array separator char (':'). |
protected |
PropertiesBean(java.lang.String root,
char arraysep)
Creates a new instance with the given root and the given array separator character. |
Method Summary | |
---|---|
void |
clean(java.util.Properties p)
Cleans the entries related to this object from the given object. |
void |
load(java.util.Properties p)
Loads the bean's properties from the given object. |
void |
save(java.util.Properties p)
Saves the bean's properties into the given object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected PropertiesBean(java.lang.String root)
root
- A non-null string that will be the "root" of the
serialized properties.protected PropertiesBean(java.lang.String root, char arraysep)
root
- A non-null string that will be the "root" of the
serialized properties.arraysep
- A character that will be used to define the
separator of elements of an array property.Method Detail |
---|
public void load(java.util.Properties p)
public void save(java.util.Properties p)
public void clean(java.util.Properties p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |