To minimize the resources used by a bean, the classes used by bean editors are loaded only
when the bean is being edited. They are not needed while the bean is running in an application
and therefore not loaded. This information is kept in what's called a bean-info (see BeanInfo ).
Unless explicitly stated, null values or empty Strings are not valid
parameters for the methods in this package. You may expect to see
exceptions if these parameters are used.
The persistence scheme cannot automatically instantiate
custom inner classes, such as you might use for event handlers.
By using the EventHandler class
instead of inner classes for custom event handlers,
you can avoid this problem.
You read and write beans in XML format using the
One notable feature of the persistence scheme is that
reading in a bean requires no special knowledge of the bean.
Writing out a bean, on the other hand,
sometimes requires special knowledge of the bean's type.
If the bean's state can be
expressed using only the no-argument constructor and
public getter and setter methods for properties,
no special knowledge is required.
Otherwise, the bean requires a custom persistence delegate --
an object that is in charge of writing out beans of a particular type.
All classes provided in the JDK that descend
as well as all their properties,
automatically have persistence delegates.
If you need (or choose) to provide a persistence delegate for a bean,
you can do so either by using a
or by creating your own subclass of PersistenceDelegate.
If the only reason a bean needs a persistence delegate
is because you want to invoke the bean's constructor with
property values as arguments,
you can create the bean's persistence delegate
with the one-argument
you need to implement your own persistence delegate,
for which you're likely to need the following classes:
Once you create a persistence delegate,
you register it using the
setPersistenceDelegate method of