update copyright
[fedora-idea.git] / java / java-impl / src / com / intellij / psi / impl / source / Constants.java
blob08ab8ea0cbfc750274c43d858abcb0cd7a6eecfd
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.psi.impl.source;
18 import com.intellij.psi.*;
19 import com.intellij.psi.impl.source.tree.ElementType;
20 import com.intellij.psi.tree.TokenSet;
22 public interface Constants extends ElementType {
24 PsiElementArrayConstructor<PsiClass> PSI_CLASS_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiClass>() {
25 public PsiClass[] newPsiElementArray(int length) {
26 return length == 0 ? PsiClass.EMPTY_ARRAY : new PsiClass[length];
30 PsiElementArrayConstructor<PsiField> PSI_FIELD_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiField>() {
31 public PsiField[] newPsiElementArray(int length) {
32 return length == 0 ? PsiField.EMPTY_ARRAY : new PsiField[length];
36 PsiElementArrayConstructor<PsiMethod> PSI_METHOD_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiMethod>() {
37 public PsiMethod[] newPsiElementArray(int length) {
38 return length == 0 ? PsiMethod.EMPTY_ARRAY : new PsiMethod[length];
42 PsiElementArrayConstructor<PsiClassInitializer> PSI_CLASS_INITIALIZER_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiClassInitializer>() {
43 public PsiClassInitializer[] newPsiElementArray(int length) {
44 return length == 0 ? PsiClassInitializer.EMPTY_ARRAY : new PsiClassInitializer[length];
48 PsiElementArrayConstructor<PsiParameter> PSI_PARAMETER_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiParameter>() {
49 public PsiParameter[] newPsiElementArray(int length) {
50 return length == 0 ? PsiParameter.EMPTY_ARRAY : new PsiParameter[length];
54 PsiElementArrayConstructor<PsiCatchSection> PSI_CATCH_SECTION_ARRAYS_CONSTRUCTOR = new PsiElementArrayConstructor<PsiCatchSection>() {
55 public PsiCatchSection[] newPsiElementArray(int length) {
56 return length == 0 ? PsiCatchSection.EMPTY_ARRAY : new PsiCatchSection[length];
60 PsiElementArrayConstructor<PsiJavaCodeReferenceElement> PSI_REFERENCE_ELEMENT_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiJavaCodeReferenceElement>() {
61 public PsiJavaCodeReferenceElement[] newPsiElementArray(int length) {
62 return length == 0 ? PsiJavaCodeReferenceElement.EMPTY_ARRAY : new PsiJavaCodeReferenceElement[length];
66 PsiElementArrayConstructor<PsiStatement> PSI_STATEMENT_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiStatement>() {
67 public PsiStatement[] newPsiElementArray(int length) {
68 return length == 0 ? PsiStatement.EMPTY_ARRAY : new PsiStatement[length];
72 PsiElementArrayConstructor<PsiExpression> PSI_EXPRESSION_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiExpression>() {
73 public PsiExpression[] newPsiElementArray(int length) {
74 return length == 0 ? PsiExpression.EMPTY_ARRAY : new PsiExpression[length];
78 PsiElementArrayConstructor<PsiImportStatement> PSI_IMPORT_STATEMENT_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiImportStatement>() {
79 public PsiImportStatement[] newPsiElementArray(int length) {
80 return length == 0 ? PsiImportStatement.EMPTY_ARRAY : new PsiImportStatement[length];
84 PsiElementArrayConstructor<PsiImportStaticStatement> PSI_IMPORT_STATIC_STATEMENT_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiImportStaticStatement>() {
85 public PsiImportStaticStatement[] newPsiElementArray(int length) {
86 return length == 0 ? PsiImportStaticStatement.EMPTY_ARRAY : new PsiImportStaticStatement[length];
91 PsiElementArrayConstructor<PsiImportStatementBase> PSI_IMPORT_STATEMENT_BASE_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiImportStatementBase>() {
92 public PsiImportStatementBase[] newPsiElementArray(int length) {
93 return length == 0 ? PsiImportStatementBase.EMPTY_ARRAY : new PsiImportStatementBase[length];
97 PsiElementArrayConstructor<PsiAnnotationMemberValue> PSI_ANNOTATION_MEMBER_VALUE_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiAnnotationMemberValue>() {
98 public PsiAnnotationMemberValue[] newPsiElementArray(int length) {
99 return length == 0 ? PsiAnnotationMemberValue.EMPTY_ARRAY : new PsiAnnotationMemberValue[length];
103 PsiElementArrayConstructor<PsiNameValuePair> PSI_NAME_VALUE_PAIR_ARRAY_CONSTRUCTOR = new PsiElementArrayConstructor<PsiNameValuePair>() {
104 public PsiNameValuePair[] newPsiElementArray(int length) {
105 return length == 0 ? PsiNameValuePair.EMPTY_ARRAY : new PsiNameValuePair[length];
109 TokenSet CLASS_BIT_SET = TokenSet.create(CLASS, ANONYMOUS_CLASS, ENUM_CONSTANT_INITIALIZER);
110 TokenSet FIELD_BIT_SET = TokenSet.create(FIELD, ENUM_CONSTANT);
111 TokenSet METHOD_BIT_SET = TokenSet.create(METHOD, ANNOTATION_METHOD);
112 TokenSet CLASS_INITIALIZER_BIT_SET = TokenSet.create(CLASS_INITIALIZER);
113 TokenSet PARAMETER_BIT_SET = TokenSet.create(PARAMETER);
114 TokenSet CATCH_SECTION_BIT_SET = TokenSet.create(CATCH_SECTION);
115 TokenSet JAVA_CODE_REFERENCE_BIT_SET = TokenSet.create(JAVA_CODE_REFERENCE);
116 TokenSet NAME_VALUE_PAIR_BIT_SET = TokenSet.create(NAME_VALUE_PAIR);
117 TokenSet ANNOTATION_BIT_SET = TokenSet.create(ANNOTATION);