final Locale locale = Locale.getDefault();
final ArrayList<String> groupingsList = new ArrayList<String>(metaData.length);
String group = null;
for (int sourceIdx = 0; sourceIdx < metaData.length; sourceIdx++)
{
final ExpressionMetaData data = metaData[sourceIdx];
if (data.isHidden())
{
continue;
}
if (StructureFunction.class.isAssignableFrom(data.getExpressionType()))
{
continue;
}
if (sourceIdx == 0)
{
group = data.getGrouping(locale);
groupingsList.add(group);
}
else
{
final String newgroup = data.getGrouping(locale);
if ((ObjectUtilities.equal(newgroup, group)) == false)
{
if (groupingsList.contains(newgroup) == false)
{
group = newgroup;
groupingsList.add(newgroup);
}
else
{
logger.warn("Warning: Misconfigured Expression-metadata: " + newgroup + " - " + // NON-NLS
data.getExpressionType());
}
}
}
}
root = new ExpressionGroupingRoot();
groupings = groupingsList.toArray(new String[groupingsList.size()]);
expressionsByGroup = new HashNMap();
for (int i = 0; i < metaData.length; i++)
{
final ExpressionMetaData exMetaData = metaData[i];
if (StructureFunction.class.isAssignableFrom(exMetaData.getExpressionType()))
{
continue;
}
if (exMetaData.isHidden() != false)
{
continue;
}
expressionsByGroup.add(exMetaData.getGrouping(Locale.getDefault()), exMetaData);
}
}