private static boolean containsType(Collection<? extends TypeMirror> collection, TypeMirror type) { for (TypeMirror otherTypeMirror : collection) { if (typeEquals(otherTypeMirror, type)) { return true; } } return false; }
private AnnotationMirror findFirstAnnotation(List<? extends Element> elements, Class<? extends Annotation> annotation) { for (Element element : elements) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(processingEnv, element, annotation); if (mirror != null) { return mirror; } } return null; }
public ParameterSpec(String name, Collection<TypeMirror> allowedTypes) { this.name = name; this.allowedTypes = allowedTypes; boolean anyTypeTemp = false; for (TypeMirror type : allowedTypes) { if (ElementUtils.isObject(type)) { anyTypeTemp = true; break; } } this.anyType = anyTypeTemp; }
public static boolean needsCastTo(TypeMirror sourceType, TypeMirror targetType) { if (typeEquals(sourceType, targetType)) { return false; } else if (isObject(targetType)) { return false; } else if (isVoid(targetType)) { return false; } else if (isAssignable(sourceType, targetType)) { return false; } return true; }
public static <T> T getAnnotationValue(Class<T> expectedType, AnnotationMirror mirror, String name) { return resolveAnnotationValue(expectedType, getAnnotationValue(mirror, name)); }
public int compare(TypeMirror o1, TypeMirror o2) { if (reverse) { return compareType(o2, o1); } else { return compareType(o1, o2); } } });
public TypeMirror getType(Class<?> element) { return ElementUtils.getType(environment, element); }
public static String typeName(TypeMirror type) { return "Implicit" + getTypeId(type) + "Cast"; }
public int compare(ExecutableElement o1, ExecutableElement o2) { return ElementUtils.compareMethod(o1, o2); } });
private static String formatType(TypeMirror type) { return type == null ? "null" : ElementUtils.getSimpleName(type); }
public ExecutableElement findExecutableElement(String name) { return ElementUtils.findExecutableElement(annotationType, name); }
public static AnnotationValue getAnnotationValue(AnnotationMirror mirror, String name) { return getAnnotationValue(mirror, name, true); }
public static boolean needsCastTo(TypeMirror sourceType, TypeMirror targetType) { if (typeEquals(sourceType, targetType)) { return false; } else if (isObject(targetType)) { return false; } else if (isVoid(targetType)) { return false; } else if (isAssignable(sourceType, targetType)) { return false; } return true; }
private static boolean containsType(Collection<? extends TypeMirror> collection, TypeMirror type) { for (TypeMirror otherTypeMirror : collection) { if (typeEquals(otherTypeMirror, type)) { return true; } } return false; }
private AnnotationMirror findFirstAnnotation(List<? extends Element> elements, Class<? extends Annotation> annotation) { for (Element element : elements) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(processingEnv, element, annotation); if (mirror != null) { return mirror; } } return null; }
public ParameterSpec(String name, Collection<TypeMirror> allowedTypes) { this.name = name; this.allowedTypes = allowedTypes; boolean anyTypeTemp = false; for (TypeMirror type : allowedTypes) { if (ElementUtils.isObject(type)) { anyTypeTemp = true; break; } } this.anyType = anyTypeTemp; }
public int compare(TypeMirror o1, TypeMirror o2) { if (reverse) { return compareType(o2, o1); } else { return compareType(o1, o2); } } });
public TypeMirror getType(Class<?> element) { return ElementUtils.getType(environment, element); }
private static String seenFieldName(TypeMirror type) { return "seen" + getTypeId(type); }