Search in sources :

Example 1 with OgnlVariableReference

use of com.intellij.lang.ognl.psi.resolve.variable.OgnlVariableReference in project intellij-plugins by JetBrains.

the class OgnlStruts2JspVariableReferencesContributor method process.

@Override
public boolean process(@NotNull PsiElement element, @NotNull PsiFile containingFile, @NotNull Processor<OgnlVariableReference> processor) {
    final PsiFile topLevelFile = InjectedLanguageManager.getInstance(containingFile.getProject()).getTopLevelFile(element);
    if (!(topLevelFile instanceof JspFile)) {
        return true;
    }
    if (StrutsFacet.getInstance(element) == null) {
        return true;
    }
    final PsiElement selfNavigation = element.getOriginalElement();
    for (String name : VAR_NAMES) {
        if (!processor.process(new OgnlVariableReference(name, "java.util.Map<String,Object>", ORIGIN_INFO, selfNavigation))) {
            return false;
        }
    }
    return true;
}
Also used : JspFile(com.intellij.psi.jsp.JspFile) OgnlVariableReference(com.intellij.lang.ognl.psi.resolve.variable.OgnlVariableReference) PsiFile(com.intellij.psi.PsiFile) PsiElement(com.intellij.psi.PsiElement)

Aggregations

OgnlVariableReference (com.intellij.lang.ognl.psi.resolve.variable.OgnlVariableReference)1 PsiElement (com.intellij.psi.PsiElement)1 PsiFile (com.intellij.psi.PsiFile)1 JspFile (com.intellij.psi.jsp.JspFile)1