org.eclipse.wst.common.frameworks.datamodel
Class DataModelPropertyDescriptor

java.lang.Object
  extended by org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor

public final class DataModelPropertyDescriptor
extends java.lang.Object

A DataModelPropertyDescriptor provides a human readible description for an IDataModel propertyValue.

Since:
1.0
See Also:
IDataModel.getPropertyDescriptor(String), IDataModel.getValidPropertyDescriptors(String)

Constructor Summary
DataModelPropertyDescriptor(java.lang.Object propertyValue)
           This is equavalent to calling DataModelPropertyDescriptor(propertyValue, null).
DataModelPropertyDescriptor(java.lang.Object propertyValue, java.lang.String propertyDescription)
           Creates a new DataModelPropertyDescriptor with the specified propertyValue and propertyDescription.
 
Method Summary
static DataModelPropertyDescriptor[] createDescriptors(java.lang.Object[] values)
           A convenience method which returns an array of DataModelPropertyDescriptors.
static DataModelPropertyDescriptor[] createDescriptors(java.lang.Object[] values, java.lang.String[] descriptions)
           A convenience method which returns an array of DataModelPropertyDescriptors.
 java.lang.String getPropertyDescription()
           Returns a human readible property description.
 java.lang.Object getPropertyValue()
           Returns the property value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataModelPropertyDescriptor

public DataModelPropertyDescriptor(java.lang.Object propertyValue)

This is equavalent to calling DataModelPropertyDescriptor(propertyValue, null).

Parameters:
propertyValue - the propery value

DataModelPropertyDescriptor

public DataModelPropertyDescriptor(java.lang.Object propertyValue,
                                   java.lang.String propertyDescription)

Creates a new DataModelPropertyDescriptor with the specified propertyValue and propertyDescription.

Parameters:
propertyValue - the property value
propertyDescription - the human readible proeprty descriptionF
Method Detail

createDescriptors

public static DataModelPropertyDescriptor[] createDescriptors(java.lang.Object[] values)

A convenience method which returns an array of DataModelPropertyDescriptors. If values is null then a 0 length array is returned. Otherwise for each values[i] in the array, a new DataModelPropertyDescriptors is created using new DataModelPropertyDescriptors(values[i]);.

Parameters:
values - the array of property values
Returns:
the constructed DataModelPropertyDescriptors array

createDescriptors

public static DataModelPropertyDescriptor[] createDescriptors(java.lang.Object[] values,
                                                              java.lang.String[] descriptions)

A convenience method which returns an array of DataModelPropertyDescriptors. If values is null then a 0 length array is returned. Otherwise for each values[i] and descriptions[i] in the arrays, a new DataModelPropertyDescriptor is created using new DataModelPropertyDescriptor(values[i], descriptions[i]);. Both arrays must be the same length.

Parameters:
values - the array of property values
descriptions - the array of property descriptions cooresponding the values array
Returns:
the constructed DataModelPropertyDescriptors array

getPropertyValue

public java.lang.Object getPropertyValue()

Returns the property value.

Returns:
the property value

getPropertyDescription

public java.lang.String getPropertyDescription()

Returns a human readible property description. If a non null description has been specified, then it will be returned. Otherwise, the property value's toString() will be returned if it is not null. Otherwise the empty String ("") will be returned. null will never be returned.

Returns:
the human readible property description, never null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object