java.lang.Object
org.gjt.sp.util.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.
- Since:
- jEdit 4.3pre7
- Author:
- Marcelo Vanzin
-
Constructor Summary
ModifierConstructorDescriptionprotected
PropertiesBean
(String root) Creates a new instance with the given root and the default array separator char (':').protected
PropertiesBean
(String root, char arraysep) Creates a new instance with the given root and the given array separator character. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clean
(Properties p) Cleans the entries related to this object from the given object.void
load
(Properties p) Loads the bean's properties from the given object.void
save
(Properties p) Saves the bean's properties into the given object.
-
Constructor Details
-
PropertiesBean
Creates a new instance with the given root and the default array separator char (':').- Parameters:
root
- A non-null string that will be the "root" of the serialized properties.
-
PropertiesBean
Creates a new instance with the given root and the given array separator character.- Parameters:
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 Details
-
load
Loads the bean's properties from the given object. -
save
Saves the bean's properties into the given object. -
clean
Cleans the entries related to this object from the given object.
-