use of com.oracle.truffle.dsl.processor.java.model.CodeAnnotationValue in project graal by oracle.
the class FixWarningsVisitor method createIgnoreDeprecations.
private CodeAnnotationMirror createIgnoreDeprecations() {
CodeAnnotationMirror mirror = new CodeAnnotationMirror(suppressWarnings);
mirror.setElementValue(mirror.findExecutableElement("value"), new CodeAnnotationValue("deprecation"));
return mirror;
}
use of com.oracle.truffle.dsl.processor.java.model.CodeAnnotationValue in project graal by oracle.
the class InstrumentableProcessor method generateWrapperAndFactory.
private CodeTypeElement generateWrapperAndFactory(ProcessorContext context, Element e) {
CodeTypeElement wrapper = generateWrapper(context, e, false);
if (wrapper == null) {
return null;
}
CodeTypeElement factory = generateFactory(context, e, wrapper);
// add @SuppressWarnings("deprecation")
DeclaredType suppressWarnings = context.getDeclaredType(SuppressWarnings.class);
CodeAnnotationMirror suppressWarningsAnnotation = new CodeAnnotationMirror(suppressWarnings);
suppressWarningsAnnotation.setElementValue(ElementUtils.findExecutableElement(suppressWarnings, "value"), new CodeAnnotationValue(Arrays.asList(new CodeAnnotationValue("deprecation"))));
factory.getAnnotationMirrors().add(suppressWarningsAnnotation);
wrapper.getModifiers().add(Modifier.STATIC);
factory.add(wrapper);
assertNoErrorExpected(e);
return factory;
}
use of com.oracle.truffle.dsl.processor.java.model.CodeAnnotationValue in project graal by oracle.
the class InstrumentableProcessor method addGeneratedBy.
private static void addGeneratedBy(ProcessorContext context, CodeTypeElement generatedType, TypeElement generatedByType) {
DeclaredType generatedBy = (DeclaredType) context.getType(GeneratedBy.class);
// only do this if generatedBy is on the classpath.
if (generatedBy != null) {
CodeAnnotationMirror generatedByAnnotation = new CodeAnnotationMirror(generatedBy);
generatedByAnnotation.setElementValue(generatedByAnnotation.findExecutableElement("value"), new CodeAnnotationValue(generatedByType.asType()));
generatedType.addAnnotationMirror(generatedByAnnotation);
}
}
Aggregations