use of com.intellij.util.xml.reflect.DomFixedChildDescription in project intellij-community by JetBrains.
the class DomImplUtil method getCustomSubTags.
public static List<XmlTag> getCustomSubTags(final DomInvocationHandler handler, final XmlTag[] subTags, final XmlFile file) {
if (subTags.length == 0) {
return Collections.emptyList();
}
final DomGenericInfoEx info = handler.getGenericInfo();
final Set<XmlName> usedNames = new THashSet<>();
List<? extends DomCollectionChildDescription> collectionChildrenDescriptions = info.getCollectionChildrenDescriptions();
//noinspection ForLoopReplaceableByForEach
for (int i = 0, size = collectionChildrenDescriptions.size(); i < size; i++) {
DomCollectionChildDescription description = collectionChildrenDescriptions.get(i);
usedNames.add(description.getXmlName());
}
List<? extends DomFixedChildDescription> fixedChildrenDescriptions = info.getFixedChildrenDescriptions();
//noinspection ForLoopReplaceableByForEach
for (int i = 0, size = fixedChildrenDescriptions.size(); i < size; i++) {
DomFixedChildDescription description = fixedChildrenDescriptions.get(i);
usedNames.add(description.getXmlName());
}
return ContainerUtil.findAll(subTags, tag -> {
if (StringUtil.isEmpty(tag.getName()))
return false;
for (final XmlName name : usedNames) {
if (isNameSuitable(name, tag, handler, file)) {
return false;
}
}
return true;
});
}
Aggregations