diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerAnnotationScanner.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerAnnotationScanner.java index 11a96074..aa9b684b 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerAnnotationScanner.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerAnnotationScanner.java @@ -18,9 +18,12 @@ import com.github.nalukit.nalu.client.component.AbstractComponentController; import com.github.nalukit.nalu.client.component.AbstractController; +import com.github.nalukit.nalu.client.component.IsAbstractComponent; +import com.github.nalukit.nalu.client.component.IsComponent; import com.github.nalukit.nalu.client.component.IsComponentCreator; import com.github.nalukit.nalu.client.component.annotation.AcceptParameter; import com.github.nalukit.nalu.client.component.annotation.Controller; +import com.github.nalukit.nalu.client.constraint.IsParameterConstraintRule; import com.github.nalukit.nalu.client.constraint.annotation.ParameterConstraint; import com.github.nalukit.nalu.processor.ProcessorException; import com.github.nalukit.nalu.processor.ProcessorUtils; @@ -95,11 +98,11 @@ private ControllerModel handleController() // handle ... TypeElement componentTypeElement = this.getComponentTypeElement(annotation); if (componentTypeElement == null) { - throw new ProcessorException("Nalu-Processor: componentTypeElement is null"); + throw new ProcessorException("Nalu-Processor: component is null"); } TypeElement componentInterfaceTypeElement = this.getComponentInterfaceTypeElement(annotation); if (componentInterfaceTypeElement == null) { - throw new ProcessorException("Nalu-Processor: @Controller - componentInterfaceTypeElement is null"); + throw new ProcessorException("Nalu-Processor: @Controller - componentInterface is null"); } TypeMirror componentTypeTypeMirror = this.getComponentType(controllerElement.asType()); // check and save the component type ... @@ -109,7 +112,8 @@ private ControllerModel handleController() ClassNameModel compareValue = new ClassNameModel(componentTypeTypeMirror.toString()); if (!metaModel.getComponentType() .equals(compareValue)) { - throw new ProcessorException("Nalu-Processor: componentType of >>" + componentTypeElement + + throw new ProcessorException("Nalu-Processor: componentType of >>" + + componentTypeElement + "<< is different (>>" + metaModel.getComponentType() .getClassName() + @@ -189,7 +193,7 @@ private void handleAcceptParameters(RoundEnvironment roundEnvironment, private TypeElement getRuleTypeElement(ParameterConstraint annotation) { try { - annotation.rule(); + Class ignore = annotation.rule(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); @@ -199,7 +203,7 @@ private TypeElement getRuleTypeElement(ParameterConstraint annotation) { private TypeElement getComponentTypeElement(Controller annotation) { try { - annotation.component(); + Class ignore = annotation.component(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); @@ -209,7 +213,7 @@ private TypeElement getComponentTypeElement(Controller annotation) { private TypeElement getComponentInterfaceTypeElement(Controller annotation) { try { - annotation.componentInterface(); + Class> ignore = annotation.componentInterface(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); @@ -337,9 +341,7 @@ public Void visitTypeVariable(TypeVariable typeVariable, // check generic! if (!componentInterfaceTypeElement.toString() .equals(result[0].toString())) { - throw new ProcessorException("Nalu-Processor: controller >>" + - element + - "<< is declared as IsComponentCreator, but the used reference of the component interface does not match with the one inside the controller."); + throw new ProcessorException("Nalu-Processor: controller >>" + element + "<< is declared as IsComponentCreator, but the used reference of the component interface does not match with the one inside the controller."); } return true; } @@ -408,7 +410,7 @@ private List getRoute(String[] routes) { if (tmpRoute.startsWith("/")) { tmpRoute = tmpRoute.substring(1); } - if (tmpRoute.length() == 0) { + if (tmpRoute.isEmpty()) { convertedRoutes.add("/"); } else { StringBuilder sbRoute = new StringBuilder(); diff --git a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerCompositesAnnotationScanner.java b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerCompositesAnnotationScanner.java index f161d565..1032731c 100644 --- a/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerCompositesAnnotationScanner.java +++ b/nalu-processor/src/main/java/com/github/nalukit/nalu/processor/scanner/ControllerCompositesAnnotationScanner.java @@ -16,6 +16,8 @@ package com.github.nalukit.nalu.processor.scanner; +import com.github.nalukit.nalu.client.component.AbstractCompositeController; +import com.github.nalukit.nalu.client.component.IsLoadCompositeCondition; import com.github.nalukit.nalu.client.component.annotation.Composite; import com.github.nalukit.nalu.client.component.annotation.Composite.Scope; import com.github.nalukit.nalu.client.component.annotation.Composites; @@ -74,7 +76,7 @@ public ControllerModel scan(RoundEnvironment roundEnvironment) { private TypeElement getCompositeTypeElement(Composite annotation) { try { - annotation.compositeController(); + Class> ignore = annotation.compositeController(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror()); @@ -84,7 +86,7 @@ private TypeElement getCompositeTypeElement(Composite annotation) { private TypeElement getCompositeConditionElement(Composite annotation) { try { - annotation.condition(); + Class ignore = annotation.condition(); } catch (MirroredTypeException exception) { return (TypeElement) this.processingEnvironment.getTypeUtils() .asElement(exception.getTypeMirror());