Search in sources :

Example 6 with ClassFilter

use of com.intellij.psi.filters.ClassFilter in project intellij-community by JetBrains.

the class XmlAttlistDeclImpl method getAttributeDecls.

@Override
public XmlAttributeDecl[] getAttributeDecls() {
    final List<XmlAttributeDecl> result = new ArrayList<>();
    processElements(new FilterElementProcessor(new ClassFilter(XmlAttributeDecl.class), result) {

        @Override
        public boolean execute(@NotNull final PsiElement element) {
            if (element instanceof XmlAttributeDecl) {
                if (element.getNextSibling() == null && element.getChildren().length == 1) {
                    return true;
                }
                return super.execute(element);
            }
            return true;
        }
    }, this);
    return result.toArray(new XmlAttributeDecl[result.size()]);
}
Also used : FilterElementProcessor(com.intellij.psi.scope.processor.FilterElementProcessor) ClassFilter(com.intellij.psi.filters.ClassFilter) ArrayList(java.util.ArrayList) PsiElement(com.intellij.psi.PsiElement)

Aggregations

ClassFilter (com.intellij.psi.filters.ClassFilter)6 PsiElement (com.intellij.psi.PsiElement)3 FilterElementProcessor (com.intellij.psi.scope.processor.FilterElementProcessor)3 ElementFilter (com.intellij.psi.filters.ElementFilter)2 ArrayList (java.util.ArrayList)2 ExpectedTypeInfo (com.intellij.codeInsight.ExpectedTypeInfo)1 Condition (com.intellij.openapi.util.Condition)1 PsiFile (com.intellij.psi.PsiFile)1 AndFilter (com.intellij.psi.filters.AndFilter)1 ExcludeDeclaredFilter (com.intellij.psi.filters.element.ExcludeDeclaredFilter)1 NamespaceFilter (com.intellij.psi.filters.position.NamespaceFilter)1 MetaDataRegistrar (com.intellij.psi.meta.MetaDataRegistrar)1 FilterScopeProcessor (com.intellij.psi.scope.processor.FilterScopeProcessor)1 XmlTag (com.intellij.psi.xml.XmlTag)1 DomElement (com.intellij.util.xml.DomElement)1 XmlElementDescriptor (com.intellij.xml.XmlElementDescriptor)1 THashSet (gnu.trove.THashSet)1 RncDocument (org.intellij.plugins.relaxNG.compact.psi.impl.RncDocument)1 RngDefine (org.intellij.plugins.relaxNG.xml.dom.RngDefine)1