mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
jsp-openapi moved to community/java
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module relativePaths="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="Annotations" />
|
||||
<orderEntry type="module" module-name="openapi" />
|
||||
<orderEntry type="module" module-name="util" />
|
||||
<orderEntry type="module" module-name="jsp-base-openapi" exported="" />
|
||||
</component>
|
||||
<component name="copyright">
|
||||
<Base>
|
||||
<setting name="state" value="0" />
|
||||
</Base>
|
||||
<LanguageOptions name="HTML">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="JAVA">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="/* * Copyright (c) 2000-05 JetBrains s.r.o. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * -Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * -Redistribution in binary form must reproduct the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * * Neither the name of JetBrains or IntelliJ IDEA * may be used to endorse or promote products derived from this software * without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. JETBRAINS AND ITS LICENSORS SHALL NOT * BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT * OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS * DERIVATIVES. IN NO EVENT WILL JETBRAINS OR ITS LICENSORS BE LIABLE FOR ANY LOST * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN * IF JETBRAINS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * */" />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="JSP">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="JavaScript">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="Properties">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="XML">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="2" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
<LanguageOptions name="__TEMPLATE__">
|
||||
<option name="templateOptions">
|
||||
<value>
|
||||
<option name="block" value="true" />
|
||||
<option name="separateBefore" value="false" />
|
||||
<option name="separateAfter" value="false" />
|
||||
<option name="prefixLines" value="true" />
|
||||
<option name="lenBefore" value="80" />
|
||||
<option name="lenAfter" value="80" />
|
||||
<option name="box" value="false" />
|
||||
<option name="filler" value=" " />
|
||||
</value>
|
||||
</option>
|
||||
<option name="notice" value="Copyright 2000-&#36;{today.year} JetBrains s.r.o. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License." />
|
||||
<option name="keyword" value="Copyright" />
|
||||
<option name="fileTypeOverride" value="4" />
|
||||
<option name="relativeBefore" value="true" />
|
||||
<option name="addBlankAfter" value="true" />
|
||||
<option name="fileLocation" value="1" />
|
||||
<option name="useAlternate" value="false" />
|
||||
</LanguageOptions>
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.xml.XmlBundle;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public interface JspInspectionGroupNames {
|
||||
String JSP_INSPECTIONS = XmlBundle.message("jsp.inspections.group.name");
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.intellij.psi;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import com.intellij.psi.jsp.JspFile;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class JspPsiUtil {
|
||||
public static boolean isInJspFile(@Nullable final PsiElement element) {
|
||||
return getJspFile(element) != null;
|
||||
}
|
||||
|
||||
public static JspFile getJspFile(final PsiElement element) {
|
||||
final PsiFile psiFile = PsiUtilBase.getTemplateLanguageFile(element);
|
||||
return psiFile instanceof JspFile ? (JspFile)psiFile : null;
|
||||
|
||||
/*final FileViewProvider provider = element.getContainingFile().getViewProvider();
|
||||
PsiFile file = provider.getPsi(StdLanguages.JSP);
|
||||
if (file instanceof JspFile) return (JspFile)file;
|
||||
file = provider.getPsi(StdLanguages.JSPX);
|
||||
return file instanceof JspFile ? (JspFile)file : null;*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.SyntheticElement;
|
||||
import com.intellij.psi.jsp.JspFile;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspClass extends PsiClass, SyntheticElement {
|
||||
JspHolderMethod getHolderMethod();
|
||||
|
||||
JspFile getJspxFile();
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiClassLevelDeclarationStatement;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspClassLevelDeclarationStatement extends PsiClassLevelDeclarationStatement {
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiCodeBlock;
|
||||
import com.intellij.psi.PsiElement;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspCodeBlock extends PsiCodeBlock {
|
||||
PsiElement[] getLocalDeclarations();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.SyntheticElement;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspHolderMethod extends PsiMethod, SyntheticElement {
|
||||
@NonNls String JSP_CONTEXT_VAR_NAME = "jspContext";
|
||||
@NonNls String APPLICATION_VAR_NAME = "application";
|
||||
@NonNls String OUT_VAR_NAME = "out";
|
||||
@NonNls String CONFIG_VAR_NAME = "config";
|
||||
@NonNls String PAGE_VAR_NAME = "page";
|
||||
@NonNls String EXCEPTION_VAR_NAME = "exception";
|
||||
@NonNls String SESSION_VAR_NAME = "session";
|
||||
@NonNls String REQUEST_VAR_NAME = "request";
|
||||
@NonNls String RESPONSE_VAR_NAME = "response";
|
||||
|
||||
JspClass getJspClass();
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiComment;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspJavaComment extends PsiComment {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiMethodCallExpression;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspMethodCall extends PsiMethodCallExpression {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiStatement;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspTemplateStatement extends PsiStatement {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiWhileStatement;
|
||||
|
||||
public interface JspWhileStatement extends PsiWhileStatement {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiImportList;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspxImportList extends PsiImportList {
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.impl.source.jsp.jspJava;
|
||||
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiImportStatement;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public interface JspxImportStatement extends PsiImportStatement {
|
||||
boolean isForeignFileImport();
|
||||
PsiFile getDeclarationFile();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.intellij.psi.jsp;
|
||||
|
||||
import com.intellij.psi.JavaElementVisitor;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class JavaJspElementVisitor extends JavaElementVisitor {
|
||||
public void visitJspImplicitVariable(JspImplicitVariable variable){
|
||||
visitImplicitVariable(variable);
|
||||
}
|
||||
|
||||
public void visitJspFile(JspFile jspFile) {
|
||||
visitFile(jspFile);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.intellij.psi.jsp;
|
||||
|
||||
import com.intellij.psi.PsiReferenceExpression;
|
||||
import com.intellij.psi.PsiBinaryExpression;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.containers.Stack;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class JavaJspRecursiveElementVisitor extends JavaJspElementVisitor {
|
||||
// This stack thing is intended to prevent exponential child traversing due to visitReferenceExpression calls both visitRefElement
|
||||
// and visitExpression.
|
||||
private final Stack<PsiReferenceExpression> myRefExprsInVisit = new Stack<PsiReferenceExpression>();
|
||||
private final Stack<PsiBinaryExpression> myBinaryExpressions = new Stack<PsiBinaryExpression>();
|
||||
|
||||
@Override
|
||||
public void visitElement(PsiElement element) {
|
||||
if (!myRefExprsInVisit.isEmpty() && myRefExprsInVisit.peek() == element) {
|
||||
myRefExprsInVisit.pop();
|
||||
myRefExprsInVisit.push(null);
|
||||
}
|
||||
else if (element instanceof PsiBinaryExpression) {
|
||||
//implement smart traversing to avoid stack overflow
|
||||
if (!myBinaryExpressions.isEmpty() && myBinaryExpressions.peek() == element) {
|
||||
return;
|
||||
}
|
||||
PsiElement child = element.getFirstChild();
|
||||
while (child != null) {
|
||||
if (child instanceof PsiBinaryExpression) {
|
||||
myBinaryExpressions.push((PsiBinaryExpression)child);
|
||||
}
|
||||
child.accept(this);
|
||||
child = child.getNextSibling();
|
||||
if (child == null) {
|
||||
child = myBinaryExpressions.isEmpty() ? null : myBinaryExpressions.pop();
|
||||
if (child != null) child = child.getFirstChild();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
element.acceptChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void visitReferenceExpression(PsiReferenceExpression expression) {
|
||||
myRefExprsInVisit.push(expression);
|
||||
try {
|
||||
visitExpression(expression);
|
||||
visitReferenceElement(expression);
|
||||
}
|
||||
finally {
|
||||
myRefExprsInVisit.pop();
|
||||
}
|
||||
}
|
||||
|
||||
//override in order to visit each root directly in visitor
|
||||
@Override public void visitJspFile(JspFile file) {
|
||||
super.visitJspFile(file);
|
||||
visitClass(file.getJavaClass());
|
||||
visitFile(file.getBaseLanguageRoot());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.jsp;
|
||||
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
|
||||
public interface JspFile extends BaseJspFile {
|
||||
JspFile[] EMPTY_ARRAY = new JspFile[0];
|
||||
|
||||
XmlTag[] getDirectiveTagsInContext(JspDirectiveKind directiveKind);
|
||||
PsiClass getJavaClass();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright 2000-2007 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.jsp;
|
||||
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.psi.ImplicitVariable;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
|
||||
public interface JspImplicitVariable extends ImplicitVariable, NavigationItem {
|
||||
JspImplicitVariable[] EMPTY_ARRAY = new JspImplicitVariable[0];
|
||||
int INSIDE = 1;
|
||||
int AFTER = 2;
|
||||
int getDeclarationRange();
|
||||
|
||||
PsiElement getDeclaration();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<!--
|
||||
~ Copyright 2000-2007 JetBrains s.r.o.
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html><body bgcolor="white">
|
||||
Provides the PSI structure for JSP files.
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user