Home » openjdk-7 » java » beans » [javadoc | source]
java.beans
public class: PropertyDescriptor [javadoc | source]
java.lang.Object
   java.beans.FeatureDescriptor
      java.beans.PropertyDescriptor

Direct Known Subclasses:
    IndexedPropertyDescriptor

A PropertyDescriptor describes one property that a Java Bean exports via a pair of accessor methods.
Constructor:
 PropertyDescriptor(PropertyDescriptor old) 
 public PropertyDescriptor(String propertyName,
    Class<?> beanClass) throws IntrospectionException 
    Constructs a PropertyDescriptor for a property that follows the standard Java convention by having getFoo and setFoo accessor methods. Thus if the argument name is "fred", it will assume that the writer method is "setFred" and the reader method is "getFred" (or "isFred" for a boolean property). Note that the property name should start with a lower case character, which will be capitalized in the method names.
    Parameters:
    propertyName - The programmatic name of the property.
    beanClass - The Class object for the target bean. For example sun.beans.OurButton.class.
    Throws:
    IntrospectionException - if an exception occurs during introspection.
    exception: IntrospectionException - if an exception occurs during introspection.
 PropertyDescriptor(PropertyDescriptor x,
    PropertyDescriptor y) 
    Package-private constructor. Merge two property descriptors. Where they conflict, give the second argument (y) priority over the first argument (x).
    Parameters:
    x - The first (lower priority) PropertyDescriptor
    y - The second (higher priority) PropertyDescriptor
 public PropertyDescriptor(String propertyName,
    Method readMethod,
    Method writeMethod) throws IntrospectionException 
    This constructor takes the name of a simple property, and Method objects for reading and writing the property.
    Parameters:
    propertyName - The programmatic name of the property.
    readMethod - The method used for reading the property value. May be null if the property is write-only.
    writeMethod - The method used for writing the property value. May be null if the property is read-only.
    Throws:
    IntrospectionException - if an exception occurs during introspection.
    exception: IntrospectionException - if an exception occurs during introspection.
 public PropertyDescriptor(String propertyName,
    Class<?> beanClass,
    String readMethodName,
    String writeMethodName) throws IntrospectionException 
    This constructor takes the name of a simple property, and method names for reading and writing the property.
    Parameters:
    propertyName - The programmatic name of the property.
    beanClass - The Class object for the target bean. For example sun.beans.OurButton.class.
    readMethodName - The name of the method used for reading the property value. May be null if the property is write-only.
    writeMethodName - The name of the method used for writing the property value. May be null if the property is read-only.
    Throws:
    IntrospectionException - if an exception occurs during introspection.
    exception: IntrospectionException - if an exception occurs during introspection.
 PropertyDescriptor(Class<?> bean,
    String base,
    Method read,
    Method write) throws IntrospectionException 
    Creates PropertyDescriptor for the specified bean with the specified name and methods to read/write the property value.
    Parameters:
    bean - the type of the target bean
    base - the base name of the property (the rest of the method name)
    read - the method used for reading the property value
    write - the method used for writing the property value
    Throws:
    IntrospectionException - if an exception occurs during introspection
    exception: IntrospectionException - if an exception occurs during introspection
    since: 1.7 -
Method from java.beans.PropertyDescriptor Summary:
appendTo,   compareMethods,   createPropertyEditor,   equals,   getBaseName,   getPropertyEditorClass,   getPropertyType,   getReadMethod,   getWriteMethod,   hashCode,   isBound,   isConstrained,   setBound,   setClass0,   setConstrained,   setPropertyEditorClass,   setReadMethod,   setWriteMethod
Methods from java.beans.FeatureDescriptor:
appendTo,   appendTo,   appendTo,   appendTo,   attributeNames,   getClass0,   getDisplayName,   getName,   getParameterTypes,   getReturnType,   getShortDescription,   getSoftReference,   getValue,   getWeakReference,   isExpert,   isHidden,   isPreferred,   isTransient,   setClass0,   setDisplayName,   setExpert,   setHidden,   setName,   setPreferred,   setShortDescription,   setTransient,   setValue,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.beans.PropertyDescriptor Detail:
  void appendTo(StringBuilder sb) 
 boolean compareMethods(Method a,
    Method b) 
    Package private helper method for Descriptor .equals methods.
 public PropertyEditor createPropertyEditor(Object bean) 
    Constructs an instance of a property editor using the current property editor class.

    If the property editor class has a public constructor that takes an Object argument then it will be invoked using the bean parameter as the argument. Otherwise, the default constructor will be invoked.

 public boolean equals(Object obj) 
    Compares this PropertyDescriptor against the specified object. Returns true if the objects are the same. Two PropertyDescriptors are the same if the read, write, property types, property editor and flags are equivalent.
 String getBaseName() 
 public Class<?> getPropertyEditorClass() 
    Gets any explicit PropertyEditor Class that has been registered for this property.
 public synchronized Class<?> getPropertyType() 
    Returns the Java type info for the property. Note that the {@code Class} object may describe primitive Java types such as {@code int}. This type is returned by the read method or is used as the parameter type of the write method. Returns {@code null} if the type is an indexed property that does not support non-indexed access.
 public synchronized Method getReadMethod() 
    Gets the method that should be used to read the property value.
 public synchronized Method getWriteMethod() 
    Gets the method that should be used to write the property value.
 public int hashCode() 
 public boolean isBound() 
    Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
 public boolean isConstrained() 
    Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is changed.
 public  void setBound(boolean bound) 
    Updates to "bound" properties will cause a "PropertyChange" event to get fired when the property is changed.
  void setClass0(Class clz) 
    Overridden to ensure that a super class doesn't take precedent
 public  void setConstrained(boolean constrained) 
    Attempted updates to "Constrained" properties will cause a "VetoableChange" event to get fired when the property is changed.
 public  void setPropertyEditorClass(Class<?> propertyEditorClass) 
    Normally PropertyEditors will be found using the PropertyEditorManager. However if for some reason you want to associate a particular PropertyEditor with a given property, then you can do it with this method.
 public synchronized  void setReadMethod(Method readMethod) throws IntrospectionException 
    Sets the method that should be used to read the property value.
 public synchronized  void setWriteMethod(Method writeMethod) throws IntrospectionException 
    Sets the method that should be used to write the property value.