use of com.intellij.util.xml.DomElementVisitor in project intellij-community by JetBrains.
the class DomElementsProblemsHolderImpl method getProblemsMap.
@NotNull
private Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> getProblemsMap(final DomElement domElement) {
final Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> map = myCachedChildrenErrors.get(domElement);
if (map != null) {
return map;
}
final Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> problems = new THashMap<>();
if (domElement == myElement) {
for (Map<Class<? extends DomElementsInspection>, List<DomElementProblemDescriptor>> listMap : myCachedErrors.values()) {
mergeMaps(problems, listMap);
}
} else {
mergeMaps(problems, myCachedErrors.get(domElement));
if (DomUtil.hasXml(domElement)) {
domElement.acceptChildren(new DomElementVisitor() {
@Override
public void visitDomElement(DomElement element) {
mergeMaps(problems, getProblemsMap(element));
}
});
}
}
myCachedChildrenErrors.put(domElement, problems);
return problems;
}
use of com.intellij.util.xml.DomElementVisitor in project intellij-plugins by JetBrains.
the class StructureViewTreeElement method getChildren.
@NotNull
public TreeElement[] getChildren() {
final DomElement element = getElement();
if (!element.isValid()) {
return EMPTY_ARRAY;
}
final List<TreeElement> result = new SmartList<>();
DomUtil.acceptAvailableChildren(element, new DomElementVisitor() {
@Override
public void visitDomElement(final DomElement domElement) {
result.add(new StructureViewTreeElement(domElement));
}
});
return ArrayUtil.toObjectArray(result, TreeElement.class);
}
use of com.intellij.util.xml.DomElementVisitor in project intellij-community by JetBrains.
the class DomElementPattern method getChildren.
@Override
protected DomElement[] getChildren(@NotNull final DomElement domElement) {
final List<DomElement> children = new ArrayList<>();
domElement.acceptChildren(new DomElementVisitor() {
@Override
public void visitDomElement(final DomElement element) {
children.add(element);
}
});
return children.toArray(new DomElement[children.size()]);
}
Aggregations