use of org.apache.tapestry5.commons.internal.NullAnnotationProvider in project tapestry-5 by apache.
the class RegistryImpl method getObject.
@Override
public <T> T getObject(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, Module localModule) {
lock.check();
AnnotationProvider effectiveProvider = annotationProvider != null ? annotationProvider : new NullAnnotationProvider();
// We do a check here for known marker/type combinations, so that you can use a marker
// annotation
// to inject into a contribution method that contributes to MasterObjectProvider.
// We also force a contribution into MasterObjectProvider to accomplish the same thing.
T result = findServiceByMarkerAndType(objectType, annotationProvider, localModule);
if (result != null)
return result;
MasterObjectProvider masterProvider = getService(IOCConstants.MASTER_OBJECT_PROVIDER_SERVICE_ID, MasterObjectProvider.class);
return masterProvider.provide(objectType, effectiveProvider, locator, true);
}
Aggregations