Search in sources :

Example 1 with AnnotationDriver

use of org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver in project kie-wb-common by kiegroup.

the class DataModelOracleModelDriver method createAnnotation.

private org.kie.workbench.common.services.datamodeller.core.Annotation createAnnotation(Annotation annotationToken) throws ModelDriverException {
    AnnotationDefinition annotationDefinition = getConfiguredAnnotation(annotationToken.getQualifiedTypeName());
    org.kie.workbench.common.services.datamodeller.core.Annotation annotation = null;
    if (annotationDefinition != null) {
        AnnotationDriver annotationDriver = getAnnotationDriver(annotationDefinition.getClassName());
        if (annotationDriver != null) {
            annotation = annotationDriver.buildAnnotation(annotationDefinition, annotationToken);
        } else {
            logger.warn("AnnotationDriver for annotation: " + annotationToken.getQualifiedTypeName() + " is not configured for this driver");
        }
    } else {
        logger.warn("Annotation: " + annotationToken.getQualifiedTypeName() + " is not configured for this driver.");
    }
    return annotation;
}
Also used : AnnotationDefinition(org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition) AnnotationDriver(org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver)

Example 2 with AnnotationDriver

use of org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriver method createAnnotation.

private Annotation createAnnotation(AnnotationSource annotationToken, ClassTypeResolver classTypeResolver) throws ModelDriverException {
    AnnotationDefinition annotationDefinition;
    Annotation annotation = null;
    annotationDefinition = buildAnnotationDefinition(annotationToken, classTypeResolver);
    if (annotationDefinition != null) {
        AnnotationDriver annotationDriver = new DefaultJavaRoasterModelAnnotationDriver();
        annotation = annotationDriver.buildAnnotation(annotationDefinition, annotationToken);
    } else {
        logger.warn("Annotation: " + annotationToken.getName() + " is not configured for this ModelDriver driver.");
    }
    return annotation;
}
Also used : AnnotationDefinition(org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition) AnnotationDriver(org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver) Annotation(org.kie.workbench.common.services.datamodeller.core.Annotation)

Aggregations

AnnotationDefinition (org.kie.workbench.common.services.datamodeller.core.AnnotationDefinition)2 AnnotationDriver (org.kie.workbench.common.services.datamodeller.driver.AnnotationDriver)2 Annotation (org.kie.workbench.common.services.datamodeller.core.Annotation)1