src/share/classes/java/beans/PropertyEditorManager.java

Print this page
rev 10053 : 8044855: Add missing @since tag under java.beans.*
Reviewed-by:


  31  * java.beans.PropertyEditor interface for editing a given object.
  32  * <P>
  33  * The PropertyEditorManager uses three techniques for locating an editor
  34  * for a given type.  First, it provides a registerEditor method to allow
  35  * an editor to be specifically registered for a given type.  Second it
  36  * tries to locate a suitable class by adding "Editor" to the full
  37  * qualified classname of the given type (e.g. "foo.bah.FozEditor").
  38  * Finally it takes the simple classname (without the package name) adds
  39  * "Editor" to it and looks in a search-path of packages for a matching
  40  * class.
  41  * <P>
  42  * So for an input class foo.bah.Fred, the PropertyEditorManager would
  43  * first look in its tables to see if an editor had been registered for
  44  * foo.bah.Fred and if so use that.  Then it will look for a
  45  * foo.bah.FredEditor class.  Then it will look for (say)
  46  * standardEditorsPackage.FredEditor class.
  47  * <p>
  48  * Default PropertyEditors will be provided for the Java primitive types
  49  * "boolean", "byte", "short", "int", "long", "float", and "double"; and
  50  * for the classes java.lang.String. java.awt.Color, and java.awt.Font.


  51  */
  52 
  53 public class PropertyEditorManager {
  54 
  55     /**
  56      * Registers an editor class to edit values of the given target class.
  57      * If the editor class is {@code null},
  58      * then any existing definition will be removed.
  59      * Thus this method can be used to cancel the registration.
  60      * The registration is canceled automatically
  61      * if either the target or editor class is unloaded.
  62      * <p>
  63      * If there is a security manager, its {@code checkPropertiesAccess}
  64      * method is called. This could result in a {@linkplain SecurityException}.
  65      *
  66      * @param targetType   the class object of the type to be edited
  67      * @param editorClass  the class object of the editor class
  68      * @throws SecurityException  if a security manager exists and
  69      *                            its {@code checkPropertiesAccess} method
  70      *                            doesn't allow setting of system properties




  31  * java.beans.PropertyEditor interface for editing a given object.
  32  * <P>
  33  * The PropertyEditorManager uses three techniques for locating an editor
  34  * for a given type.  First, it provides a registerEditor method to allow
  35  * an editor to be specifically registered for a given type.  Second it
  36  * tries to locate a suitable class by adding "Editor" to the full
  37  * qualified classname of the given type (e.g. "foo.bah.FozEditor").
  38  * Finally it takes the simple classname (without the package name) adds
  39  * "Editor" to it and looks in a search-path of packages for a matching
  40  * class.
  41  * <P>
  42  * So for an input class foo.bah.Fred, the PropertyEditorManager would
  43  * first look in its tables to see if an editor had been registered for
  44  * foo.bah.Fred and if so use that.  Then it will look for a
  45  * foo.bah.FredEditor class.  Then it will look for (say)
  46  * standardEditorsPackage.FredEditor class.
  47  * <p>
  48  * Default PropertyEditors will be provided for the Java primitive types
  49  * "boolean", "byte", "short", "int", "long", "float", and "double"; and
  50  * for the classes java.lang.String. java.awt.Color, and java.awt.Font.
  51  *
  52  * @since 1.1
  53  */
  54 
  55 public class PropertyEditorManager {
  56 
  57     /**
  58      * Registers an editor class to edit values of the given target class.
  59      * If the editor class is {@code null},
  60      * then any existing definition will be removed.
  61      * Thus this method can be used to cancel the registration.
  62      * The registration is canceled automatically
  63      * if either the target or editor class is unloaded.
  64      * <p>
  65      * If there is a security manager, its {@code checkPropertiesAccess}
  66      * method is called. This could result in a {@linkplain SecurityException}.
  67      *
  68      * @param targetType   the class object of the type to be edited
  69      * @param editorClass  the class object of the editor class
  70      * @throws SecurityException  if a security manager exists and
  71      *                            its {@code checkPropertiesAccess} method
  72      *                            doesn't allow setting of system properties