logger.warn("Expression '" + expression.getExpressionType() + " is null");
}
try
{
final BeanInfo beanInfo = expression.getBeanDescriptor();
if (beanInfo == null)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Cannot get BeanDescriptor: Null");
}
}
catch (IntrospectionException e)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Cannot get BeanDescriptor", e);
}
final Locale locale = Locale.getDefault();
final String displayName = expression.getDisplayName(locale);
if (isValid(displayName, expression.getName()) == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": No valid display name");
}
if (expression.isDeprecated())
{
deprecatedExpressionsCounter += 1;
final String deprecateMessage = expression.getDeprecationMessage(locale);
if (isValid(deprecateMessage, "Use a Formula instead") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": No valid deprecate message");
}
}
final String grouping = expression.getGrouping(locale);
if (isValid(grouping, "Group") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": No valid grouping message");
}
expressionsByGroup.add(grouping, expression);
final ExpressionPropertyMetaData[] properties = expression.getPropertyDescriptions();
for (int j = 0; j < properties.length; j++)
{
final ExpressionPropertyMetaData propertyMetaData = properties[j];
final String name = propertyMetaData.getName();
if (StringUtils.isEmpty(name))
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property without a name");
}
final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
if (isValid(propertyDisplayName, name) == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No DisplayName");
}
final String propertyGrouping = propertyMetaData.getGrouping(locale);
if (isValid(propertyGrouping, "Group") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping is not valid");
}
final int groupingOrdinal = propertyMetaData.getGroupingOrdinal(locale);
if (groupingOrdinal == Integer.MAX_VALUE)
{
if (propertyMetaData instanceof DefaultExpressionMetaData)
{
final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
missingProperties.add(demd.getKeyPrefix() + "grouping.ordinal=1000");
}
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Grouping ordinal is not valid");
}
final int ordinal = propertyMetaData.getItemOrdinal(locale);
if (groupingOrdinal == Integer.MAX_VALUE)
{
if (propertyMetaData instanceof DefaultExpressionMetaData)
{
final DefaultExpressionPropertyMetaData demd = (DefaultExpressionPropertyMetaData) propertyMetaData;
missingProperties.add(demd.getKeyPrefix() + "ordinal=1000");
}
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Ordinal is not valid");
}
final String propertyDescription = propertyMetaData.getDescription(locale);
if (isValid(propertyDescription, "") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Description is not valid");
}
final String propertyDeprecated = propertyMetaData.getDeprecationMessage(locale);
if (isValid(propertyDeprecated, "") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Deprecation is not valid");
}
final String role = propertyMetaData.getPropertyRole();
if (isValid(role, "Value") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Role is not valid");
}
final Class propertyType = propertyMetaData.getPropertyType();
if (propertyType == null)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": Property Type is not valid");
}
// should not crash!
final PropertyDescriptor propertyDescriptor = propertyMetaData.getBeanDescriptor();
if (propertyMetaData.isDeprecated())
{
final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
if (isValid(deprecateMessage, "Deprecated") == false)
{
logger.warn("Expression '" + expression.getExpressionType() + ": Property " + propertyMetaData.getName() + ": No valid deprecate message");
}
}
}
try
{
final BeanInfo beanInfo = Introspector.getBeanInfo(expression.getExpressionType());
final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
for (int propIdx = 0; propIdx < descriptors.length; propIdx++)
{
final PropertyDescriptor descriptor = descriptors[propIdx];
final String key = descriptor.getName();