Search in sources :

Example 1 with GeneratedBy

use of com.oracle.truffle.api.dsl.GeneratedBy 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);
    }
}
Also used : CodeAnnotationMirror(com.oracle.truffle.dsl.processor.java.model.CodeAnnotationMirror) GeneratedBy(com.oracle.truffle.api.dsl.GeneratedBy) DeclaredType(javax.lang.model.type.DeclaredType) CodeAnnotationValue(com.oracle.truffle.dsl.processor.java.model.CodeAnnotationValue)

Aggregations

GeneratedBy (com.oracle.truffle.api.dsl.GeneratedBy)1 CodeAnnotationMirror (com.oracle.truffle.dsl.processor.java.model.CodeAnnotationMirror)1 CodeAnnotationValue (com.oracle.truffle.dsl.processor.java.model.CodeAnnotationValue)1 DeclaredType (javax.lang.model.type.DeclaredType)1