PropertyInfo
Provides runtime reflection metadata on a property.
- Object
- SitedObject
- PropertyInfo
Remarks
This class has utility methods e.g. validating values of properties, converting property values to strings, and getting the editor id to use for the property. PropertyInfo contains the following properties:
Property | Description |
ID_displayName | The natural-language localized display name for the property, or null if there is no known display name. |
ID_descriptor | A single-letter string that describes the underlying storage type for the property (see below). |
ID_values | If this is an enum property, then values will be a list of the valid possible values for the enum. |
ID_displayNames | If this is an enum property, then ID_displayNames is a list of the English-language display names for each enum. |
The ID_descriptor property indicates the underlying storage type for the property, and can be one of the following:
Descriptor | Storage Type |
I | 32-bit int. |
D | 64-bit floating point. |
F | 32-bit floating point. |
Z | boolean. |
T | DateTime. |
E | Enum. |
S | String. |
Methods
addEventHandler (inherited from SitedObject) | Adds a delegate to be called when the specified eventId occurs on this object. |
equals (inherited from SitedObject) | Tests if two objects are equal. |
fireEventHandler (inherited from SitedObject) | Invokes any user event handlers registered for a particular event using SitedObject.addEventHandler(). |
getBindingStatus (inherited from SitedObject) | Provides debugging information on bindings for this object. |
getEditorId | Given a PropertyInfo, return the editor ID to use. |
getPathValue (inherited from SitedObject) | Traverses a binding path and returns the value at the end of it. |
getPropertyInfo (inherited from SitedObject) | Gets information on a property. |
getSite (inherited from SitedObject) | Gets this object's site. |
getValue (inherited from SitedObject) | Gets the value of a property on this object. |
onSetValue (inherited from SitedObject) | Called by SitedObject.setValue() when a property value is set on this object. |
onSited (inherited from SitedObject) | Called when this object is sited. |
onUnsited (inherited from SitedObject) | Called when this object is about to lose its site. |
onValueSited (inherited from SitedObject) | Called when an object is sited within this object. |
onValueUnsited (inherited from SitedObject) | Called when an object is about to be unsited in this. |
removeEventHandler (inherited from SitedObject) | Remove an existing delegate from the list of delegates for the specified event. |
setInitialValues (inherited from SitedObject) | Sets multiple property values on an object (during initialization only) |
setPathValue (inherited from SitedObject) | Traverses a binding path and sets the value at the end of it. |
setValue (inherited from SitedObject) | Sets the value of a property on this object. |
stringToValue | Converts strVal to an appropriate value for this property. |
toString (inherited from SitedObject) | Returns a string representation of this object. |
validate | Validates strVal according to type information in this PropertyInfo. |
valueToString | Given the value of a property associated with this PropertyInfo, return a string representation |
PropertyInfo getEditorId method
Given a PropertyInfo, return the editor ID to use.
JavaScript
propertyInfo.getEditorId()
Remarks
Used by the PropertyGrid control.
If this PropertyInfo has an ID_editorId property, the value of that property is returned.
Otherwise, this returns ID_TEXT for strings and number properties, ID_BOOL for boolean properties, ID_DATE for dateTimes, and ID_ENUM for enums.
PropertyInfo stringToValue method
Converts strVal to an appropriate value for this property.
JavaScript
propertyInfo.stringToValue(strVal)
Remarks
This examines the type information held in this property and uses it to
convert the string value into an appropriate underlying value. If the string cannot be
converted this returns undefined.
PropertyInfo validate method
Validates strVal according to type information in this PropertyInfo.
JavaScript
propertyInfo.validate(strVal)
Remarks
Returns null if the strVal is a valid value for this property.
If strVal is invalid, returns a string describing the
vaidation error.
PropertyInfo valueToString method
Given the value of a property associated with this PropertyInfo,
return a string representation
JavaScript
propertyInfo.valueToString(val)
Remarks
This examines this PropertyInfo and uses it to convert the property value
value into an appropriate string. If the string cannot be converted
this returns undefined.