Search in sources :

Example 1 with BeanElement

use of io.micronaut.inject.ast.beans.BeanElement in project micronaut-core by micronaut-projects.

the class JavaVisitorContext method printMessage.

private void printMessage(String message, Diagnostic.Kind kind, @Nullable io.micronaut.inject.ast.Element element) {
    if (StringUtils.isNotEmpty(message)) {
        if (element instanceof BeanElement) {
            element = ((BeanElement) element).getDeclaringClass();
        }
        if (element instanceof AbstractJavaElement) {
            Element el = (Element) element.getNativeType();
            messager.printMessage(kind, message, el);
        } else {
            messager.printMessage(kind, message);
        }
    }
}
Also used : BeanElement(io.micronaut.inject.ast.beans.BeanElement) PackageElement(javax.lang.model.element.PackageElement) ClassElement(io.micronaut.inject.ast.ClassElement) TypeElement(javax.lang.model.element.TypeElement) BeanElement(io.micronaut.inject.ast.beans.BeanElement) Element(javax.lang.model.element.Element)

Aggregations

ClassElement (io.micronaut.inject.ast.ClassElement)1 BeanElement (io.micronaut.inject.ast.beans.BeanElement)1 Element (javax.lang.model.element.Element)1 PackageElement (javax.lang.model.element.PackageElement)1 TypeElement (javax.lang.model.element.TypeElement)1