Search in sources :

Example 1 with MappedCoordinator

use of me.panavtec.coordinator.compiler.model.MappedCoordinator in project Coordinator-java by PaNaVTEC.

the class CoordinatorProcessor method processAnnotations.

public Collection<EnclosingCoordinator> processAnnotations(RoundEnvironment roundEnv) {
    Collection<EnclosingCoordinator> enclosings = processCoordinators(roundEnv);
    List<MappedCompleteCoordinator> complete = processComplete(roundEnv);
    List<MappedCoordinatedAction> actions = processCoordinatedActions(roundEnv);
    for (EnclosingCoordinator enclosing : enclosings) {
        for (MappedCoordinator coordinator : enclosing.getCoordinators()) {
            assignAction(actions, enclosing, coordinator);
            assignCompleteAction(complete, enclosing, coordinator);
        }
        checkForCompleteErrors(enclosing);
    }
    return enclosings;
}
Also used : MappedCompleteCoordinator(me.panavtec.coordinator.compiler.model.MappedCompleteCoordinator) EnclosingCoordinator(me.panavtec.coordinator.compiler.model.EnclosingCoordinator) MappedCoordinator(me.panavtec.coordinator.compiler.model.MappedCoordinator) MappedCoordinatedAction(me.panavtec.coordinator.compiler.model.MappedCoordinatedAction)

Example 2 with MappedCoordinator

use of me.panavtec.coordinator.compiler.model.MappedCoordinator in project Coordinator-java by PaNaVTEC.

the class EnclosingCoordinatorProcessor method processActionsOfCoordinator.

private MappedCoordinator processActionsOfCoordinator(Element e) {
    Actions mappedAnnotation = annotationForElement(e);
    MappedCoordinator mappedCoordinator = new MappedCoordinator();
    mappedCoordinator.setActions(mappedAnnotation.value());
    mappedCoordinator.setCoordinatorId(mappedAnnotation.coordinatorId());
    mappedCoordinator.setCoordinatorField(elementTools.getFieldName(e));
    return mappedCoordinator;
}
Also used : Actions(me.panavtec.coordinator.qualifiers.Actions) MappedCoordinator(me.panavtec.coordinator.compiler.model.MappedCoordinator)

Example 3 with MappedCoordinator

use of me.panavtec.coordinator.compiler.model.MappedCoordinator in project Coordinator-java by PaNaVTEC.

the class CoordinatorWriter method writeInstantation.

private void writeInstantation(Filer filer, EnclosingCoordinator parent) throws IOException {
    List<MappedCoordinator> coordinators = parent.getCoordinators();
    MethodSpec.Builder methodBuilder = createMetod(parent);
    for (MappedCoordinator coordinator : coordinators) {
        addNewCoordinatorStatement(methodBuilder, coordinator);
        addCompleteActions(methodBuilder, coordinator);
    }
    TypeSpec coordinateInjectorClass = createInjectClass(parent, methodBuilder.build());
    JavaFile.builder(parent.getPackageName(), coordinateInjectorClass).addFileComment("Do not modify this file!").build().writeTo(filer);
}
Also used : MethodSpec(com.squareup.javapoet.MethodSpec) MappedCoordinator(me.panavtec.coordinator.compiler.model.MappedCoordinator) TypeSpec(com.squareup.javapoet.TypeSpec)

Aggregations

MappedCoordinator (me.panavtec.coordinator.compiler.model.MappedCoordinator)3 MethodSpec (com.squareup.javapoet.MethodSpec)1 TypeSpec (com.squareup.javapoet.TypeSpec)1 EnclosingCoordinator (me.panavtec.coordinator.compiler.model.EnclosingCoordinator)1 MappedCompleteCoordinator (me.panavtec.coordinator.compiler.model.MappedCompleteCoordinator)1 MappedCoordinatedAction (me.panavtec.coordinator.compiler.model.MappedCoordinatedAction)1 Actions (me.panavtec.coordinator.qualifiers.Actions)1