src/share/classes/java/beans/PropertyEditor.java

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


  34  * only need to support a subset of the different options available in
  35  * this API.
  36  * <P>
  37  * Simple PropertyEditors may only support the getAsText and setAsText
  38  * methods and need not support (say) paintValue or getCustomEditor.  More
  39  * complex types may be unable to support getAsText and setAsText but will
  40  * instead support paintValue and getCustomEditor.
  41  * <p>
  42  * Every propertyEditor must support one or more of the three simple
  43  * display styles.  Thus it can either (1) support isPaintable or (2)
  44  * both return a non-null String[] from getTags() and return a non-null
  45  * value from getAsText or (3) simply return a non-null String from
  46  * getAsText().
  47  * <p>
  48  * Every property editor must support a call on setValue when the argument
  49  * object is of the type for which this is the corresponding propertyEditor.
  50  * In addition, each property editor must either support a custom editor,
  51  * or support setAsText.
  52  * <p>
  53  * Each PropertyEditor should have a null constructor.


  54  */
  55 
  56 public interface PropertyEditor {
  57 
  58     /**
  59      * Set (or change) the object that is to be edited.  Primitive types such
  60      * as "int" must be wrapped as the corresponding object type such as
  61      * "java.lang.Integer".
  62      *
  63      * @param value The new target object to be edited.  Note that this
  64      *     object should not be modified by the PropertyEditor, rather
  65      *     the PropertyEditor should create a new object to hold any
  66      *     modified value.
  67      */
  68     void setValue(Object value);
  69 
  70     /**
  71      * Gets the property value.
  72      *
  73      * @return The value of the property.  Primitive types such as "int" will




  34  * only need to support a subset of the different options available in
  35  * this API.
  36  * <P>
  37  * Simple PropertyEditors may only support the getAsText and setAsText
  38  * methods and need not support (say) paintValue or getCustomEditor.  More
  39  * complex types may be unable to support getAsText and setAsText but will
  40  * instead support paintValue and getCustomEditor.
  41  * <p>
  42  * Every propertyEditor must support one or more of the three simple
  43  * display styles.  Thus it can either (1) support isPaintable or (2)
  44  * both return a non-null String[] from getTags() and return a non-null
  45  * value from getAsText or (3) simply return a non-null String from
  46  * getAsText().
  47  * <p>
  48  * Every property editor must support a call on setValue when the argument
  49  * object is of the type for which this is the corresponding propertyEditor.
  50  * In addition, each property editor must either support a custom editor,
  51  * or support setAsText.
  52  * <p>
  53  * Each PropertyEditor should have a null constructor.
  54  *
  55  * @since 1.1
  56  */
  57 
  58 public interface PropertyEditor {
  59 
  60     /**
  61      * Set (or change) the object that is to be edited.  Primitive types such
  62      * as "int" must be wrapped as the corresponding object type such as
  63      * "java.lang.Integer".
  64      *
  65      * @param value The new target object to be edited.  Note that this
  66      *     object should not be modified by the PropertyEditor, rather
  67      *     the PropertyEditor should create a new object to hold any
  68      *     modified value.
  69      */
  70     void setValue(Object value);
  71 
  72     /**
  73      * Gets the property value.
  74      *
  75      * @return The value of the property.  Primitive types such as "int" will