/** * Returns the {@code FileHandler} associated with this builder. If already * a result object has been created, this {@code FileHandler} can be used to * save it. Otherwise, the {@code FileHandler} from the initialization * parameters is returned (which is not associated with a {@code FileBased} * object). Result is never <b>null</b>. * * @return the {@code FileHandler} associated with this builder */ public synchronized FileHandler getFileHandler() { return (currentFileHandler != null) ? currentFileHandler : fetchFileHandlerFromParameters(); }
/** * {@inheritDoc} This implementation deals with the creation and * initialization of a {@code FileHandler} associated with the new result * object. */ @Override protected void initResultInstance(final T obj) throws ConfigurationException { super.initResultInstance(obj); final FileHandler srcHandler = (currentFileHandler != null && !resetParameters) ? currentFileHandler : fetchFileHandlerFromParameters(); currentFileHandler = new FileHandler(obj, srcHandler); if (autoSaveListener != null) { autoSaveListener.updateFileHandler(currentFileHandler); } initFileHandler(currentFileHandler); resetParameters = false; }