Module jEdit

Class PropertiesBean

java.lang.Object
org.gjt.sp.util.PropertiesBean

public abstract class PropertiesBean extends Object
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

    Constructors
    Modifier
    Constructor
    Description
    protected
    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 Type
    Method
    Description
    void
    Cleans the entries related to this object from the given object.
    void
    Loads the bean's properties from the given object.
    void
    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 Details

    • PropertiesBean

      protected PropertiesBean(String root)
      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

      protected PropertiesBean(String root, char arraysep)
      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

      public void load(Properties p)
      Loads the bean's properties from the given object.
    • save

      public void save(Properties p)
      Saves the bean's properties into the given object.
    • clean

      public void clean(Properties p)
      Cleans the entries related to this object from the given object.