src/share/classes/java/beans/FeatureDescriptor.java

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


  29 
  30 import java.lang.ref.Reference;
  31 import java.lang.ref.WeakReference;
  32 import java.lang.ref.SoftReference;
  33 
  34 import java.lang.reflect.Method;
  35 
  36 import java.util.Enumeration;
  37 import java.util.Hashtable;
  38 import java.util.Map.Entry;
  39 
  40 /**
  41  * The FeatureDescriptor class is the common baseclass for PropertyDescriptor,
  42  * EventSetDescriptor, and MethodDescriptor, etc.
  43  * <p>
  44  * It supports some common information that can be set and retrieved for
  45  * any of the introspection descriptors.
  46  * <p>
  47  * In addition it provides an extension mechanism so that arbitrary
  48  * attribute/value pairs can be associated with a design feature.


  49  */
  50 
  51 public class FeatureDescriptor {
  52     private static final String TRANSIENT = "transient";
  53 
  54     private Reference<? extends Class<?>> classRef;
  55 
  56     /**
  57      * Constructs a <code>FeatureDescriptor</code>.
  58      */
  59     public FeatureDescriptor() {
  60     }
  61 
  62     /**
  63      * Gets the programmatic name of this feature.
  64      *
  65      * @return The programmatic name of the property/method/event
  66      */
  67     public String getName() {
  68         return name;


 128      */
 129     public boolean isHidden() {
 130         return hidden;
 131     }
 132 
 133     /**
 134      * The "hidden" flag is used to identify features that are intended only
 135      * for tool use, and which should not be exposed to humans.
 136      *
 137      * @param hidden  True if this feature should be hidden from human users.
 138      */
 139     public void setHidden(boolean hidden) {
 140         this.hidden = hidden;
 141     }
 142 
 143     /**
 144      * The "preferred" flag is used to identify features that are particularly
 145      * important for presenting to humans.
 146      *
 147      * @return True if this feature should be preferentially shown to human users.

 148      */
 149     public boolean isPreferred() {
 150         return preferred;
 151     }
 152 
 153     /**
 154      * The "preferred" flag is used to identify features that are particularly
 155      * important for presenting to humans.
 156      *
 157      * @param preferred  True if this feature should be preferentially shown
 158      *                   to human users.

 159      */
 160     public void setPreferred(boolean preferred) {
 161         this.preferred = preferred;
 162     }
 163 
 164     /**
 165      * Gets the short description of this feature.
 166      *
 167      * @return  A localized short description associated with this
 168      *   property/method/event.  This defaults to be the display name.
 169      */
 170     public String getShortDescription() {
 171         if (shortDescription == null) {
 172             return getDisplayName();
 173         }
 174         return shortDescription;
 175     }
 176 
 177     /**
 178      * You can associate a short descriptive string with a feature.  Normally




  29 
  30 import java.lang.ref.Reference;
  31 import java.lang.ref.WeakReference;
  32 import java.lang.ref.SoftReference;
  33 
  34 import java.lang.reflect.Method;
  35 
  36 import java.util.Enumeration;
  37 import java.util.Hashtable;
  38 import java.util.Map.Entry;
  39 
  40 /**
  41  * The FeatureDescriptor class is the common baseclass for PropertyDescriptor,
  42  * EventSetDescriptor, and MethodDescriptor, etc.
  43  * <p>
  44  * It supports some common information that can be set and retrieved for
  45  * any of the introspection descriptors.
  46  * <p>
  47  * In addition it provides an extension mechanism so that arbitrary
  48  * attribute/value pairs can be associated with a design feature.
  49  *
  50  * @since 1.1
  51  */
  52 
  53 public class FeatureDescriptor {
  54     private static final String TRANSIENT = "transient";
  55 
  56     private Reference<? extends Class<?>> classRef;
  57 
  58     /**
  59      * Constructs a <code>FeatureDescriptor</code>.
  60      */
  61     public FeatureDescriptor() {
  62     }
  63 
  64     /**
  65      * Gets the programmatic name of this feature.
  66      *
  67      * @return The programmatic name of the property/method/event
  68      */
  69     public String getName() {
  70         return name;


 130      */
 131     public boolean isHidden() {
 132         return hidden;
 133     }
 134 
 135     /**
 136      * The "hidden" flag is used to identify features that are intended only
 137      * for tool use, and which should not be exposed to humans.
 138      *
 139      * @param hidden  True if this feature should be hidden from human users.
 140      */
 141     public void setHidden(boolean hidden) {
 142         this.hidden = hidden;
 143     }
 144 
 145     /**
 146      * The "preferred" flag is used to identify features that are particularly
 147      * important for presenting to humans.
 148      *
 149      * @return True if this feature should be preferentially shown to human users.
 150      * @since 1.2
 151      */
 152     public boolean isPreferred() {
 153         return preferred;
 154     }
 155 
 156     /**
 157      * The "preferred" flag is used to identify features that are particularly
 158      * important for presenting to humans.
 159      *
 160      * @param preferred  True if this feature should be preferentially shown
 161      *                   to human users.
 162      * @since 1.2
 163      */
 164     public void setPreferred(boolean preferred) {
 165         this.preferred = preferred;
 166     }
 167 
 168     /**
 169      * Gets the short description of this feature.
 170      *
 171      * @return  A localized short description associated with this
 172      *   property/method/event.  This defaults to be the display name.
 173      */
 174     public String getShortDescription() {
 175         if (shortDescription == null) {
 176             return getDisplayName();
 177         }
 178         return shortDescription;
 179     }
 180 
 181     /**
 182      * You can associate a short descriptive string with a feature.  Normally