boolean (XmlTag element, Processor<? super XmlTag> tagProcessor, Set<? super XmlTag> visited) { if (!visited.add(element)) return true; boolean exhaustiveEnum = true; for (final XmlTag tag : element.getSubTags()) { final @NonNls String localName = tag.getLocalName(); if (localName.equals(ENUMERATION_TAG_NAME)) { final String attributeValue = tag.getAttributeValue(VALUE_ATTR_NAME); if (attributeValue != null) { if (!tagProcessor.process(tag)) { return exhaustiveEnum; } } } else if (localName.equals("union")) { exhaustiveEnum = false; processEnumerationValues(tag, tagProcessor, visited); XmlAttribute attribute = tag.getAttribute("memberTypes"); if (attribute != null && attribute.getValueElement() != null) { for (PsiReference reference : attribute.getValueElement().getReferences()) { PsiElement resolve = reference.resolve(); if (resolve instanceof XmlTag) { processEnumerationValues((XmlTag)resolve, tagProcessor, visited); } } } } else if (localName.equals("extension")) { XmlTag base = XmlSchemaTagsProcessor.resolveTagReference(tag.getAttribute("base")); if (base != null) { return processEnumerationValues(base, tagProcessor, visited); } } else if (!doNotVisitTags.contains(localName)) { // don't go into annotation exhaustiveEnum &= processEnumerationValues(tag, tagProcessor, visited); } } return exhaustiveEnum; }