use of com.intellij.psi.filters.AndFilter in project intellij-community by JetBrains.
the class ApplicationLoader method registerMetaData.
private static void registerMetaData() {
final MetaDataRegistrar registrar = MetaDataRegistrar.getInstance();
registrar.registerMetaData(new AndFilter(new NamespaceFilter(RNG_NAMESPACE), new ClassFilter(XmlDocument.class)), RngNsDescriptor.class);
registrar.registerMetaData(new ClassFilter(RncDocument.class), RngNsDescriptor.class);
registrar.registerMetaData(new ElementFilter() {
@Override
public boolean isAcceptable(Object element, PsiElement context) {
if (element instanceof XmlTag) {
final XmlTag tag = (XmlTag) element;
final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag);
return domElement instanceof RngDefine;
}
return false;
}
@Override
public boolean isClassAcceptable(Class hintClass) {
return XmlTag.class.isAssignableFrom(hintClass);
}
}, RngDefineMetaData.class);
}
Aggregations