wt.clients.beans
Class PropertyItem

java.lang.Object
  extended bywt.clients.beans.PropertyItem
All Implemented Interfaces:
Explorable, Identifiable, ReferenceHolder

public class PropertyItem
extends Object
implements Explorable

This is a model class for PropertyDescriptor objects. It implements the Explorable interface to allow displaying class attributes in the WTExplorer.

Supported API: false

Extendable: false

See Also:
PropertyDescriptor, WTExplorer, ClassExplorer, Explorable

Field Summary
private  PropertyDescriptor propertyDescriptor
           
 
Constructor Summary
PropertyItem(PropertyDescriptor pd)
          Construct a PropertyItem from the specified PropertyDescriptor.
PropertyItem(String className, String attributename)
          Construct a PropertyItem for the specified class and attribute.
 
Method Summary
 Explorable[] getContents()
          Implemented to satisfy the Explorable interface.
 String getDefinedAs()
          Return where the property was originally defined.
 String getDescription()
          Return the shortDescription attribute from the contained PropertyDescriptor.
 String getDisplayName()
          Return the displayName attribute from the contained PropertyDescriptor.
 String getIdentity()
          Implemented to satisfy the Explorable interface.
 int getLowerLimit()
          Return the lower limit specified for the attribute.
 String getName()
          Return the name attribute from the contained PropertyDescriptor.
 Object getObject()
          Implemented to satisfy the Explorable interface.
 Image getOpenIcon()
          Implemented to satisfy the Explorable interface.
 PropertyDescriptor getPropertyDescriptor()
          Gets the PropertyDescriptor for the PropertyItem .
 Class getPropertyType()
          Return the propertyType attribute from the contained PropertyDescriptor.
 String getPropertyTypeClassName()
          Return the name of the propertyType attribute from the contained PropertyDescriptor.
 Image getStandardIcon()
          Implemented to satisfy the Explorable interface.
 String getUniqueIdentity()
          Implemented to satisfy the Explorable interface.
 int getUpperLimit()
          Return the upper limit specified for the attribute.
 Explorable[] getUses()
          Implemented to satisfy the Explorable interface.
protected  Method getWriteMethod(Class objectClass)
          Return a setter method for this property for the specified class.
 boolean isExpert()
          Determine if the property is "expert" .
 boolean isHidden()
          Determine if the property is "hidden" .
 boolean isReadable()
          Determine if the property is readable (it has a getter() method).
 boolean isRequired()
          Determine if the property is required.
 boolean isUpdateable()
          Determine if the property is updateable.
 boolean isWriteable()
          Determine if the property is writeable (it has a setter() method).
 boolean isWriteable(Class objectClass)
          Determine if the property is writeable (it has a setter() method).
 void setObject(Object obj)
          Implemented to satisfy the Explorable interface.
 void setPropertyDescriptor(PropertyDescriptor pd)
          Sets the PropertyDescriptor for the PropertyItem .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyDescriptor

private PropertyDescriptor propertyDescriptor
Constructor Detail

PropertyItem

public PropertyItem(String className,
                    String attributename)
             throws WTIntrospectionException
Construct a PropertyItem for the specified class and attribute.

Parameters:
className - the specified class
attributename - the specified attribute name
Throws:
WTIntrospectionException - if an introspection error occurred

PropertyItem

public PropertyItem(PropertyDescriptor pd)
Construct a PropertyItem from the specified PropertyDescriptor.

Parameters:
pd - the specified PropertyDescriptor.
Method Detail

setPropertyDescriptor

public void setPropertyDescriptor(PropertyDescriptor pd)
Sets the PropertyDescriptor for the PropertyItem .

Parameters:
pd - the specified PropertyDescriptor.

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor()
Gets the PropertyDescriptor for the PropertyItem .

Returns:
the current PropertyDescriptor.

getIdentity

public String getIdentity()
Implemented to satisfy the Explorable interface.

Specified by:
getIdentity in interface Identifiable
Returns:
the name of the Property

getUniqueIdentity

public String getUniqueIdentity()
Implemented to satisfy the Explorable interface.

Specified by:
getUniqueIdentity in interface Identifiable
Returns:
the name of the Property

getUses

public Explorable[] getUses()
                     throws WTException
Implemented to satisfy the Explorable interface.

Specified by:
getUses in interface Explorable
Returns:
null
Throws:
WTException
See Also:
WTException

getContents

public Explorable[] getContents()
                         throws WTException
Implemented to satisfy the Explorable interface.

Specified by:
getContents in interface Explorable
Returns:
null
Throws:
WTException
See Also:
WTException

getObject

public Object getObject()
Implemented to satisfy the Explorable interface.

Specified by:
getObject in interface ReferenceHolder
Returns:
the contained PropertyDescriptor

setObject

public void setObject(Object obj)
Implemented to satisfy the Explorable interface.

Specified by:
setObject in interface ReferenceHolder

getStandardIcon

public Image getStandardIcon()
Implemented to satisfy the Explorable interface.

Specified by:
getStandardIcon in interface Identifiable
Returns:
null

getOpenIcon

public Image getOpenIcon()
Implemented to satisfy the Explorable interface.

Specified by:
getOpenIcon in interface Identifiable
Returns:
null

getName

public String getName()
Return the name attribute from the contained PropertyDescriptor.


getDescription

public String getDescription()
Return the shortDescription attribute from the contained PropertyDescriptor.


getDisplayName

public String getDisplayName()
Return the displayName attribute from the contained PropertyDescriptor.


getPropertyType

public Class getPropertyType()
Return the propertyType attribute from the contained PropertyDescriptor.


getPropertyTypeClassName

public String getPropertyTypeClassName()
Return the name of the propertyType attribute from the contained PropertyDescriptor.


getUpperLimit

public int getUpperLimit()
Return the upper limit specified for the attribute. If nothing is specified, return 0.

See Also:
WTIntrospector.UPPER_LIMIT

getLowerLimit

public int getLowerLimit()
Return the lower limit specified for the attribute. If nothing is specified, return 0.

See Also:
WTIntrospector.LOWER_LIMIT

isRequired

public boolean isRequired()
Determine if the property is required.

Returns:
true if property is required; otherwise, false
See Also:
WTIntrospector.REQUIRED

isUpdateable

public boolean isUpdateable()
Determine if the property is updateable.

Returns:
true if property is updateable; otherwise, false
See Also:
WTIntrospector.UPDATEABLE

isReadable

public boolean isReadable()
Determine if the property is readable (it has a getter() method).

Returns:
true if property is readable; otherwise, false

isWriteable

public boolean isWriteable()
Determine if the property is writeable (it has a setter() method).

Returns:
true if property is writeable; otherwise, false

isWriteable

public boolean isWriteable(Class objectClass)
Determine if the property is writeable (it has a setter() method).

Returns:
true if property is writeable; otherwise, false

isHidden

public boolean isHidden()
Determine if the property is "hidden" .

Returns:
true if property is hidden; otherwise, false

isExpert

public boolean isExpert()
Determine if the property is "expert" .

Returns:
true if property is expert; otherwise, false

getDefinedAs

public String getDefinedAs()
Return where the property was originally defined.

Returns:
a string with a fully qualified class name and the name of the attribute.

getWriteMethod

protected Method getWriteMethod(Class objectClass)
Return a setter method for this property for the specified class.

Note: the normal PropertyDescriptor.getWriteMethod() is not used to avoid security exceptions under the JVM for Netscape Navigator.