{
Item item = context.getItem();
if (requiredItemPropertyList != null && item != null)
{
StringBuffer errMsg = null;
ObjectDescriptor od = null;
int n = requiredItemPropertyList.size();
for (int i = 0; i < n; ++i)
{
String property = (String) requiredItemPropertyList.get(i);
Object value = null;
try
{
value = PropertyAccessUtil.getProperty(item, property);
}
catch (PropertyException e)
{
System.err.println("Cannot access property '" + property + "': " + e);
}
if (value == null)
{
// Property not present
if (errMsg == null)
{
// Initial text
errMsg = new StringBuffer("The following required properties of the component have not been set:\n");
try
{
// Get the object descriptor, but skip errors
od = ObjectDescriptorMgr.getInstance().getDescriptor(item.getClass(), 0);
}
catch (XMLDriverException e)
{
System.err.println("Cannot access object descriptor for class '" + item.getClass().getName() + "': " + e);
}
}
else
{
errMsg.append('\n');
}
String displayName = null;
if (od != null)
{
// Try to get the display name of the property from the
// object descriptor of the item
PropertyDescriptor pd = od.getProperty(property);
if (pd != null)
displayName = pd.getDisplayName();
}
if (displayName == null)
displayName = property;