Added PsiAnnotationWithFlags interface uniting JetClassAnnotation and JetMethodAnnotation.
This commit is contained in:
+2
-1
@@ -28,7 +28,7 @@ import java.util.BitSet;
|
|||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
*/
|
*/
|
||||||
public class JetClassAnnotation extends PsiAnnotationWrapper {
|
public class JetClassAnnotation extends PsiAnnotationWithFlags {
|
||||||
|
|
||||||
public JetClassAnnotation(@Nullable PsiAnnotation psiAnnotation) {
|
public JetClassAnnotation(@Nullable PsiAnnotation psiAnnotation) {
|
||||||
super(psiAnnotation);
|
super(psiAnnotation);
|
||||||
@@ -44,6 +44,7 @@ public class JetClassAnnotation extends PsiAnnotationWrapper {
|
|||||||
|
|
||||||
|
|
||||||
private BitSet flags = null;
|
private BitSet flags = null;
|
||||||
|
@NotNull
|
||||||
public BitSet flags() {
|
public BitSet flags() {
|
||||||
if (flags == null) {
|
if (flags == null) {
|
||||||
flags = BitSetUtils.toBitSet(getIntAttribute(JvmStdlibNames.JET_CLASS_FLAGS_FIELD, JvmStdlibNames.FLAGS_DEFAULT_VALUE));
|
flags = BitSetUtils.toBitSet(getIntAttribute(JvmStdlibNames.JET_CLASS_FLAGS_FIELD, JvmStdlibNames.FLAGS_DEFAULT_VALUE));
|
||||||
|
|||||||
+2
-1
@@ -28,13 +28,14 @@ import java.util.BitSet;
|
|||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
*/
|
*/
|
||||||
public class JetMethodAnnotation extends PsiAnnotationWrapper {
|
public class JetMethodAnnotation extends PsiAnnotationWithFlags {
|
||||||
|
|
||||||
public JetMethodAnnotation(@Nullable PsiAnnotation psiAnnotation) {
|
public JetMethodAnnotation(@Nullable PsiAnnotation psiAnnotation) {
|
||||||
super(psiAnnotation);
|
super(psiAnnotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BitSet flags = null;
|
private BitSet flags = null;
|
||||||
|
@NotNull
|
||||||
public BitSet flags() {
|
public BitSet flags() {
|
||||||
if (flags == null) {
|
if (flags == null) {
|
||||||
int flagsValue = getIntAttribute(JvmStdlibNames.JET_METHOD_FLAGS_FIELD, JvmStdlibNames.FLAGS_DEFAULT_VALUE);
|
int flagsValue = getIntAttribute(JvmStdlibNames.JET_METHOD_FLAGS_FIELD, JvmStdlibNames.FLAGS_DEFAULT_VALUE);
|
||||||
|
|||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2012 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 org.jetbrains.jet.lang.resolve.java.kt;
|
||||||
|
|
||||||
|
import com.intellij.psi.PsiAnnotation;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.BitSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Evgeny Gerashchenko
|
||||||
|
* @since 6/14/12
|
||||||
|
*/
|
||||||
|
public abstract class PsiAnnotationWithFlags extends PsiAnnotationWrapper {
|
||||||
|
protected PsiAnnotationWithFlags(@Nullable PsiAnnotation psiAnnotation) {
|
||||||
|
super(psiAnnotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public abstract BitSet flags();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user