if (child == base) {
continue;
} else if (child instanceof ValueElement) {
// check value reference to enumeration type
IClass type = ((ValueElement)child).getType();
if (isEnumeration(type)) {
countEnumUsage(type.getName());
}
} else if (child instanceof CollectionElement) {
// check for collection item type
CollectionElement collect = (CollectionElement)child;
IClass itype = collect.getItemTypeClass();
if (isEnumeration(itype)) {
// collection items are enumeration type, count directly
countEnumUsage(itype.getName());
} else if (!isSimpleValue(itype)) {
// find implied mapping, if one defined
String type = itype.getName();
TemplateElementBase ref = collect.getDefinitions().getSpecificTemplate(type);
if (ref instanceof MappingElement) {
MappingElement mapref = (MappingElement)ref;
MappingDetail detail = forceMappingDetail(mapref);
detail.setElement(true);