/** * Returns a {@code ReloadingDetectorFactory} either from the passed in * parameters or a default factory. * * @param params the current parameters object * @return the {@code ReloadingDetectorFactory} to be used */ private static ReloadingDetectorFactory fetchDetectorFactory( final FileBasedBuilderParametersImpl params) { final ReloadingDetectorFactory factory = params.getReloadingDetectorFactory(); return (factory != null) ? factory : DEFAULT_DETECTOR_FACTORY; } }
/** * {@inheritDoc} This implementation takes some properties defined in this * class into account. */ @Override public void inheritFrom(final Map<String, ?> source) { super.inheritFrom(source); final FileBasedBuilderParametersImpl srcParams = fromParameters(source); if (srcParams != null) { setFileSystem(srcParams.getFileHandler().getFileSystem()); setLocationStrategy( srcParams.getFileHandler().getLocationStrategy()); if (srcParams.getFileHandler().getEncoding() != null) { setEncoding(srcParams.getFileHandler().getEncoding()); } if (srcParams.getReloadingDetectorFactory() != null) { setReloadingDetectorFactory( srcParams.getReloadingDetectorFactory()); } if (srcParams.getReloadingRefreshDelay() != null) { setReloadingRefreshDelay(srcParams.getReloadingRefreshDelay()); } } }