public InjectHelper(ValidatorHelper validatorHelper, MethodInjectionHandler<T> handler) { this.codeModelHelper = new APTCodeModelHelper(validatorHelper.environment()); this.validatorHelper = validatorHelper; this.handler = handler; }
protected AnnotationElements validatedModel() { return environment().getValidatedElements(); }
public void doesNotHaveAnyOfSupportedAnnotations(Element element, ElementValidation validation) { Set<String> supportedAnnotationTypes = environment().getSupportedAnnotationTypes(); for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) { if (supportedAnnotationTypes.contains(annotationMirror.getAnnotationType().toString())) { validation.addError(element, "method injection does only allow the annotation to be placed on the method OR on each parameter."); break; } } }
public ValidatorHelper(TargetAnnotationHelper targetAnnotationHelper) { annotationHelper = targetAnnotationHelper; param = new ValidatorParameterHelper(annotationHelper); parcelerHelper = new ParcelerHelper(environment()); }
public void enclosingElementHasAndroidAnnotation(Element element, ElementValidation valid) { enclosingElementHasOneOfAnnotations(element, environment().getGeneratingAnnotations(), valid); }
public void typeIsValid(Class<? extends Annotation> annotation, TypeMirror elementType, ElementValidation elementValidation) { Set<? extends Element> validElements = validatedModel().getRootAnnotatedElements(annotation.getName()); Set<? extends Element> extractedElements = environment().getExtractedElements().getRootAnnotatedElements(annotation.getName()); Element typeElement = annotationHelper.getTypeUtils().asElement(elementType); if (!extractedElements.contains(typeElement) || validElements.contains(typeElement)) { return; } elementValidation.addError("The type " + typeElement.getSimpleName() + " is invalid, " + "please check the messages on that type."); }
public void androidService(Element element, ElementValidation valid) { Element targetElement = findTargetElement(element, valid); if (targetElement == null) { return; } AndroidSystemServices androidSystemServices = new AndroidSystemServices(environment()); TypeMirror serviceType = targetElement.asType(); if (!androidSystemServices.contains(serviceType)) { valid.addError("Unknown service type: " + serviceType.toString()); } }
public InjectHelper(ValidatorHelper validatorHelper, MethodInjectionHandler<T> handler) { this.codeModelHelper = new APTCodeModelHelper(validatorHelper.environment()); this.validatorHelper = validatorHelper; this.handler = handler; }
protected AnnotationElements validatedModel() { return environment().getValidatedElements(); }
public void doesNotHaveAnyOfSupportedAnnotations(Element element, ElementValidation validation) { Set<String> supportedAnnotationTypes = environment().getSupportedAnnotationTypes(); for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) { if (supportedAnnotationTypes.contains(annotationMirror.getAnnotationType().toString())) { validation.addError(element, "method injection does only allow the annotation to be placed on the method OR on each parameter."); break; } } }
public ValidatorHelper(TargetAnnotationHelper targetAnnotationHelper) { annotationHelper = targetAnnotationHelper; param = new ValidatorParameterHelper(annotationHelper); parcelerHelper = new ParcelerHelper(environment()); }
public void enclosingElementHasAndroidAnnotation(Element element, ElementValidation valid) { enclosingElementHasOneOfAnnotations(element, environment().getGeneratingAnnotations(), valid); }
public void typeIsValid(Class<? extends Annotation> annotation, TypeMirror elementType, ElementValidation elementValidation) { Set<? extends Element> validElements = validatedModel().getRootAnnotatedElements(annotation.getName()); Set<? extends Element> extractedElements = environment().getExtractedElements().getRootAnnotatedElements(annotation.getName()); Element typeElement = annotationHelper.getTypeUtils().asElement(elementType); if (!extractedElements.contains(typeElement) || validElements.contains(typeElement)) { return; } elementValidation.addError("The type " + typeElement.getSimpleName() + " is invalid, " + "please check the messages on that type."); }
public void androidService(Element element, ElementValidation valid) { Element targetElement = findTargetElement(element, valid); if (targetElement == null) { return; } AndroidSystemServices androidSystemServices = new AndroidSystemServices(environment()); TypeMirror serviceType = targetElement.asType(); if (!androidSystemServices.contains(serviceType)) { valid.addError("Unknown service type: " + serviceType.toString()); } }