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 void typeOrTargetValueHasAnnotation(Class<? extends Annotation> annotation, Element element, ElementValidation valid) { Element targetElement = findTargetElement(element, valid); if (targetElement == null) { return; } DeclaredType targetAnnotationClassValue = annotationHelper.extractAnnotationClassParameter(element); if (targetAnnotationClassValue != null) { targetElement = targetAnnotationClassValue.asElement(); if (!annotationHelper.getTypeUtils().isAssignable(targetAnnotationClassValue, targetElement.asType())) { valid.addError("The value of %s must be assignable into the annotated field"); } } typeHasValidAnnotation(annotation, targetElement, valid); }
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 void typeOrTargetValueHasAnnotation(Class<? extends Annotation> annotation, Element element, ElementValidation valid) { Element targetElement = findTargetElement(element, valid); if (targetElement == null) { return; } DeclaredType targetAnnotationClassValue = annotationHelper.extractAnnotationClassParameter(element); if (targetAnnotationClassValue != null) { targetElement = targetAnnotationClassValue.asElement(); if (!annotationHelper.getTypeUtils().isAssignable(targetAnnotationClassValue, targetElement.asType())) { valid.addError("The value of %s must be assignable into the annotated field"); } } typeHasValidAnnotation(annotation, targetElement, valid); }