/** * Create a ReflectionDesire that immediately wraps the given * InjectionPoint. The desired type equals the type declared by the * injection point. The created desire will have a satisfaction if the * injection point's type is satisfiable. * * @param injectPoint The injection point to wrap * @throws NullPointerException if injectPoint is null */ public ReflectionDesire(InjectionPoint injectPoint) { this(injectPoint.getErasedType(), injectPoint, null); }
protected String format(InjectionPoint ip) { return format(ip, ip.getErasedType()); }
protected String format(InjectionPoint ip, Class<?> type) { if (type == null) { type = ip.getErasedType(); } String base = (ip.getQualifier() != null ? ip.getQualifier() + ":" : ""); String name = type == null ? null : type.getName(); return base + name; } }
Preconditions.isAssignable(injectPoint.getErasedType(), desiredType); if (satisfaction != null) { Preconditions.isAssignable(desiredType, satisfaction.getErasedType());