@Override public boolean matches(TypeLiteral<?> typeLiteral) { return typeLiteral.getRawType() == Class.class; }
Class<? super T> getRawType() { return typeLiteral.getRawType(); }
@Override @SuppressWarnings("unchecked") public Object convert(String value, TypeLiteral<?> toType) { return Enum.valueOf((Class) toType.getRawType(), value); }
/** * Returns true if the key type is Provider (but not a subclass of Provider). */ static boolean isProvider(Key<?> key) { return key.getTypeLiteral().getRawType().equals(Provider.class); }
Class<F> factoryRawType = (Class) factoryType.getRawType(); return factoryRawType.cast(Proxy.newProxyInstance(factoryRawType.getClassLoader(), new Class[]{factoryRawType}, invocationHandler));
/** * Returns true if the key type is MembersInjector (but not a subclass of MembersInjector). */ static boolean isMembersInjector(Key<?> key) { return key.getTypeLiteral().getRawType().equals(MembersInjector.class) && !key.hasAnnotationType(); }
private static <M extends Member & AnnotatedElement> void addInjectionPoints(TypeLiteral<?> type, Factory<M> factory, boolean statics, Collection<InjectionPoint> injectionPoints, Errors errors) { if (type.getType() == Object.class) { return; } // Add injectors for superclass first. TypeLiteral<?> superType = type.getSupertype(type.getRawType().getSuperclass()); addInjectionPoints(superType, factory, statics, injectionPoints, errors); // Add injectors for all members next addInjectorsForMembers(type, factory, statics, injectionPoints, errors); }
Class<?> rawType = key.getTypeLiteral().getRawType();
ImplementedBy implementedBy, Errors errors) throws ErrorsException { Class<?> rawType = key.getTypeLiteral().getRawType(); Class<?> implementationType = implementedBy.value();
@Override @SuppressWarnings("unchecked") public Object convert(String value, TypeLiteral<?> toType) { return Enum.valueOf((Class) toType.getRawType(), value); }
@Override @SuppressWarnings("unchecked") public Object convert(String value, TypeLiteral<?> toType) { return Enum.valueOf((Class) toType.getRawType(), value); }
final Class<?> rawType = key.getTypeLiteral().getRawType(); final Class<? extends Provider<?>> providerType = providedBy.value();
if (!type.getRawType().isInstance(converted)) { throw errors.conversionTypeError(stringValue, source, type, matchingConverter, converted) .toException();
/** * Returns true if the key type is Provider (but not a subclass of Provider). */ static boolean isProvider(Key<?> key) { return key.getTypeLiteral().getRawType().equals(Provider.class); }
/** * Returns true if the key type is Provider (but not a subclass of Provider). */ static boolean isProvider(Key<?> key) { return key.getTypeLiteral().getRawType().equals(Provider.class); }
Class<? super T> rawType = key.getTypeLiteral().getRawType();
/** * Returns true if the key type is MembersInjector (but not a subclass of MembersInjector). */ static boolean isMembersInjector(Key<?> key) { return key.getTypeLiteral().getRawType().equals(MembersInjector.class) && !key.hasAnnotationType(); }
/** * Returns true if the key type is MembersInjector (but not a subclass of MembersInjector). */ static boolean isMembersInjector(Key<?> key) { return key.getTypeLiteral().getRawType().equals(MembersInjector.class) && !key.hasAnnotationType(); }
Object source = key.getTypeLiteral().getRawType(); BindingImpl<T> binding = createUnitializedBinding(key, Scoping.UNSCOPED, source, errors); initializeBinding(binding, errors);
private static <M extends Member & AnnotatedElement> void addInjectionPoints(TypeLiteral<?> type, Factory<M> factory, boolean statics, Collection<InjectionPoint> injectionPoints, Errors errors) { if (type.getType() == Object.class) { return; } // Add injectors for superclass first. TypeLiteral<?> superType = type.getSupertype(type.getRawType().getSuperclass()); addInjectionPoints(superType, factory, statics, injectionPoints, errors); // Add injectors for all members next addInjectorsForMembers(type, factory, statics, injectionPoints, errors); }