/** * Looks up an instance of this class in the specified parameters map. This * is equivalent to {@code fromParameters(params, false};} * * @param params the map with parameters (must not be <b>null</b> * @return the instance obtained from the map or <b>null</b> * @throws IllegalArgumentException if the map is <b>null</b> */ public static FileBasedBuilderParametersImpl fromParameters( final Map<String, ?> params) { return fromParameters(params, false); }
/** * {@inheritDoc} This implementation also takes care that a new * {@code ReloadingDetector} for the new current {@code FileHandler} is * created. Also, the reloading controller's reloading state has to be * reset; after the creation of a new result object changes in the * underlying configuration source have to be monitored again. */ @Override protected void initFileHandler(final FileHandler handler) throws ConfigurationException { super.initFileHandler(handler); resultReloadingDetector = createReloadingDetector(handler, FileBasedBuilderParametersImpl.fromParameters( getParameters(), true)); }
/** * Obtains the {@code FileHandler} from this builder's parameters. If no * {@code FileBasedBuilderParametersImpl} object is found in this builder's * parameters, a new one is created now and stored. This makes it possible * to change the location of the associated file even if no parameters * object was provided. * * @return the {@code FileHandler} from initialization parameters */ private FileHandler fetchFileHandlerFromParameters() { FileBasedBuilderParametersImpl fileParams = FileBasedBuilderParametersImpl.fromParameters(getParameters(), false); if (fileParams == null) { fileParams = new FileBasedBuilderParametersImpl(); addParameters(fileParams.getParameters()); } return fileParams.getFileHandler(); }
FileBasedBuilderParametersImpl.fromParameters(params); if (fileParams != null)
/** * {@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()); } } }