use of com.intellij.psi.PsiModifierList in project Intellij-Plugin by getgauge.
the class HookUtilTest method TestIsHookWhenNonHookAnnotation.
@Test
public void TestIsHookWhenNonHookAnnotation() throws Exception {
PsiMethod method = mock(PsiMethod.class);
PsiModifierList list = mock(PsiModifierList.class);
PsiAnnotation annotation = mock(PsiAnnotation.class);
when(annotation.getQualifiedName()).thenReturn("Unequal");
when(list.getAnnotations()).thenReturn(new PsiAnnotation[] { annotation });
when(method.getModifierList()).thenReturn(list);
assertFalse(HookUtil.isHook(method));
}
use of com.intellij.psi.PsiModifierList in project Intellij-Plugin by getgauge.
the class HookUtilTest method TestIsHook.
@Test
public void TestIsHook() throws Exception {
PsiMethod method = mock(PsiMethod.class);
PsiModifierList list = mock(PsiModifierList.class);
PsiAnnotation annotation = mock(PsiAnnotation.class);
when(annotation.getQualifiedName()).thenReturn(BeforeStep.class.getCanonicalName());
when(list.getAnnotations()).thenReturn(new PsiAnnotation[] { annotation });
when(method.getModifierList()).thenReturn(list);
assertTrue(HookUtil.isHook(method));
}
use of com.intellij.psi.PsiModifierList in project smali by JesusFreke.
the class SmalideaClassDef method getAccessFlags.
@Override
public int getAccessFlags() {
PsiModifierList modifierList = psiClass.getModifierList();
int flags = 0;
if (modifierList == null) {
return flags;
}
if (modifierList.hasModifierProperty("public")) {
flags |= AccessFlags.PUBLIC.getValue();
}
if (modifierList.hasModifierProperty("final")) {
flags |= AccessFlags.FINAL.getValue();
}
if (modifierList.hasModifierProperty("abstract")) {
flags |= AccessFlags.ABSTRACT.getValue();
}
if (psiClass.isInterface()) {
flags |= AccessFlags.INTERFACE.getValue();
}
if (psiClass.isEnum()) {
flags |= AccessFlags.ENUM.getValue();
}
if (psiClass.isAnnotationType()) {
flags |= AccessFlags.ANNOTATION.getValue();
}
return flags;
}
use of com.intellij.psi.PsiModifierList in project smali by JesusFreke.
the class SmalideaField method getAccessFlags.
@Override
public int getAccessFlags() {
if (psiField instanceof SmaliField) {
return ((SmaliField) psiField).getModifierList().getAccessFlags();
} else {
int flags = 0;
PsiModifierList modifierList = psiField.getModifierList();
if (modifierList == null) {
return flags;
}
if (modifierList.hasModifierProperty("public")) {
flags |= AccessFlags.PUBLIC.getValue();
} else if (modifierList.hasModifierProperty("protected")) {
flags |= AccessFlags.PROTECTED.getValue();
} else if (modifierList.hasModifierProperty("private")) {
flags |= AccessFlags.PRIVATE.getValue();
}
if (modifierList.hasModifierProperty("static")) {
flags |= AccessFlags.STATIC.getValue();
}
if (modifierList.hasModifierProperty("final")) {
flags |= AccessFlags.FINAL.getValue();
}
if (modifierList.hasModifierProperty("volatile")) {
flags |= AccessFlags.VOLATILE.getValue();
}
return flags;
}
}
use of com.intellij.psi.PsiModifierList in project android by JetBrains.
the class PsiCFGField method parseModifiers.
private void parseModifiers() {
PsiModifierList modifierList = mPsiFieldRef.getModifierList();
modifierBits = Modifier.ParseModifierList(modifierList);
}
Aggregations