List<Annotation> mergedResult = new ArrayList<Annotation>();
for (Annotation inheritedAnnotation : inheritedMetaData)
{
ViewMetaData viewMetaData = inheritedAnnotation.annotationType().getAnnotation(ViewMetaData.class);
if (viewMetaData == null)
{
continue;
}
Aggregated aggregated = inheritedAnnotation.annotationType().getAnnotation(Aggregated.class);
if (aggregated == null)
{
aggregated = viewMetaData.annotationType().getAnnotation(Aggregated.class);
}
if (aggregated.value()) //aggregation for the whole annotation is allowed
{
mergedResult.add(inheritedAnnotation);