use of org.glassfish.jersey.internal.inject.InjecteeImpl in project jersey by jersey.
the class InjectionResolverWrapper method resolve.
@Override
public Object resolve(Injectee injectee, ServiceHandle root) {
InjecteeImpl injecteeWrapper = new InjecteeImpl();
injecteeWrapper.setRequiredType(injectee.getRequiredType());
injecteeWrapper.setParent(injectee.getParent());
injecteeWrapper.setRequiredQualifiers(injectee.getRequiredQualifiers());
injecteeWrapper.setOptional(injectee.isOptional());
injecteeWrapper.setPosition(injectee.getPosition());
injecteeWrapper.setFactory(ReflectionHelper.isSubClassOf(injectee.getRequiredType(), Factory.class));
injecteeWrapper.setInjecteeDescriptor(new ForeignDescriptorImpl(injectee.getInjecteeDescriptor()));
Object instance = jerseyResolver.resolve(injecteeWrapper);
if (injecteeWrapper.isFactory()) {
return asFactory(instance);
} else {
return instance;
}
}
use of org.glassfish.jersey.internal.inject.InjecteeImpl in project jersey by jersey.
the class DelegatedInjectionValueSupplierProvider method getInjectee.
/**
* Creates a new object {@link Injectee} corresponding to the injecting point. The injectee contains basic information
* about the injection point types and {@link ForeignDescriptor} of the underlying DI provider to make delegated injection
* resolver as simple as possible.
*
* @param parameter jersey-like parameter corresponding to one resource-method's parameter.
* @return injectee instance as a source of the information about the injecting point.
*/
private Injectee getInjectee(Parameter parameter) {
InjecteeImpl injectee = new InjecteeImpl();
injectee.setRequiredType(parameter.getType());
injectee.setInjecteeClass(parameter.getRawType());
ForeignDescriptor proxyDescriptor = descriptorCache.apply(parameter);
if (proxyDescriptor != null) {
injectee.setInjecteeDescriptor(proxyDescriptor);
}
return injectee;
}
Aggregations