src/java.desktop/share/classes/java/beans/Encoder.java

Print this page




 119      * If a persistence delegate is associated with the given type
 120      * by using the {@link #setPersistenceDelegate} method
 121      * it is returned.
 122      * <li>
 123      * A persistence delegate is then looked up by the name
 124      * composed of the fully qualified name of the given type
 125      * and the "PersistenceDelegate" postfix.
 126      * For example, a persistence delegate for the {@code Bean} class
 127      * should be named {@code BeanPersistenceDelegate}
 128      * and located in the same package.
 129      * <pre>
 130      * public class Bean { ... }
 131      * public class BeanPersistenceDelegate { ... }</pre>
 132      * The instance of the {@code BeanPersistenceDelegate} class
 133      * is returned for the {@code Bean} class.
 134      * <li>
 135      * If the type is {@code null},
 136      * a shared internal persistence delegate is returned
 137      * that encodes {@code null} value.
 138      * <li>
 139      * If the type is a {@code enum} declaration,
 140      * a shared internal persistence delegate is returned
 141      * that encodes constants of this enumeration
 142      * by their names.
 143      * <li>
 144      * If the type is a primitive type or the corresponding wrapper,
 145      * a shared internal persistence delegate is returned
 146      * that encodes values of the given type.
 147      * <li>
 148      * If the type is an array,
 149      * a shared internal persistence delegate is returned
 150      * that encodes an array of the appropriate type and length,
 151      * and each of its elements as if they are properties.
 152      * <li>
 153      * If the type is a proxy,
 154      * a shared internal persistence delegate is returned
 155      * that encodes a proxy instance by using
 156      * the {@link java.lang.reflect.Proxy#newProxyInstance} method.
 157      * <li>
 158      * If the {@link BeanInfo} for this type has a {@link BeanDescriptor}
 159      * which defined a "persistenceDelegate" attribute,




 119      * If a persistence delegate is associated with the given type
 120      * by using the {@link #setPersistenceDelegate} method
 121      * it is returned.
 122      * <li>
 123      * A persistence delegate is then looked up by the name
 124      * composed of the fully qualified name of the given type
 125      * and the "PersistenceDelegate" postfix.
 126      * For example, a persistence delegate for the {@code Bean} class
 127      * should be named {@code BeanPersistenceDelegate}
 128      * and located in the same package.
 129      * <pre>
 130      * public class Bean { ... }
 131      * public class BeanPersistenceDelegate { ... }</pre>
 132      * The instance of the {@code BeanPersistenceDelegate} class
 133      * is returned for the {@code Bean} class.
 134      * <li>
 135      * If the type is {@code null},
 136      * a shared internal persistence delegate is returned
 137      * that encodes {@code null} value.
 138      * <li>
 139      * If the type is an {@code enum} declaration,
 140      * a shared internal persistence delegate is returned
 141      * that encodes constants of this enumeration
 142      * by their names.
 143      * <li>
 144      * If the type is a primitive type or the corresponding wrapper,
 145      * a shared internal persistence delegate is returned
 146      * that encodes values of the given type.
 147      * <li>
 148      * If the type is an array,
 149      * a shared internal persistence delegate is returned
 150      * that encodes an array of the appropriate type and length,
 151      * and each of its elements as if they are properties.
 152      * <li>
 153      * If the type is a proxy,
 154      * a shared internal persistence delegate is returned
 155      * that encodes a proxy instance by using
 156      * the {@link java.lang.reflect.Proxy#newProxyInstance} method.
 157      * <li>
 158      * If the {@link BeanInfo} for this type has a {@link BeanDescriptor}
 159      * which defined a "persistenceDelegate" attribute,