use of org.eclipse.jdt.core.IAnnotation in project che by eclipse.
the class StubCreator method appendFlags.
protected void appendFlags(final IMember member) throws JavaModelException {
if (member instanceof IAnnotatable)
for (IAnnotation annotation : ((IAnnotatable) member).getAnnotations()) {
appendAnnotation(annotation);
}
int flags = member.getFlags();
final int kind = member.getElementType();
if (kind == IJavaElement.TYPE) {
flags &= ~Flags.AccSuper;
final IType type = (IType) member;
if (!type.isMember())
flags &= ~Flags.AccPrivate;
if (Flags.isEnum(flags))
flags &= ~Flags.AccAbstract;
}
if (Flags.isEnum(flags))
flags &= ~Flags.AccFinal;
if (kind == IJavaElement.METHOD) {
flags &= ~Flags.AccVarargs;
flags &= ~Flags.AccBridge;
}
if (flags != 0)
fBuffer.append(Flags.toString(flags));
}
use of org.eclipse.jdt.core.IAnnotation in project che by eclipse.
the class JavaElementLabelComposer method appendAnnotationLabels.
protected void appendAnnotationLabels(IAnnotation[] annotations, long flags) throws JavaModelException {
for (int j = 0; j < annotations.length; j++) {
IAnnotation annotation = annotations[j];
appendAnnotationLabel(annotation, flags);
fBuffer.append(' ');
}
}
use of org.eclipse.jdt.core.IAnnotation in project xtext-eclipse by eclipse.
the class JavaElementDelegateJunitLaunch method containsElementsSearchedFor.
@Override
protected boolean containsElementsSearchedFor(IFile file) {
IJavaElement element = JavaCore.create(file);
if (element == null || !element.exists() || !(element instanceof ICompilationUnit)) {
return false;
}
try {
ICompilationUnit cu = (ICompilationUnit) element;
for (IType type : cu.getAllTypes()) {
for (IMethod method : type.getMethods()) {
int flags = method.getFlags();
if (Modifier.isPublic(flags) && !Modifier.isStatic(flags) && method.getNumberOfParameters() == 0 && Signature.SIG_VOID.equals(method.getReturnType()) && method.getElementName().startsWith("test")) {
// $NON-NLS-1$
return true;
}
// $NON-NLS-1$
IAnnotation annotation = method.getAnnotation("Test");
if (annotation.exists())
return true;
}
}
} catch (JavaModelException e) {
log.error(e.getMessage(), e);
}
return super.containsElementsSearchedFor(file);
}
use of org.eclipse.jdt.core.IAnnotation in project eclipse.jdt.ls by eclipse.
the class JavaElementLabelComposer method appendAnnotationLabels.
protected void appendAnnotationLabels(IAnnotation[] annotations, long flags) throws JavaModelException {
for (int j = 0; j < annotations.length; j++) {
IAnnotation annotation = annotations[j];
appendAnnotationLabel(annotation, flags);
fBuilder.append(' ');
}
}
use of org.eclipse.jdt.core.IAnnotation in project che by eclipse.
the class SourcesFromBytecodeGenerator method appendAnnotationLabels.
protected void appendAnnotationLabels(IAnnotation[] annotations, long flags, StringBuilder builder, String indent) throws JavaModelException {
for (IAnnotation annotation : annotations) {
builder.append(indent);
appendAnnotationLabel(annotation, flags, builder);
builder.append('\n');
}
}
Aggregations