/** * Saves the resource to the writer using the specified options. * <p> * This implementation is <code>final</code>; * clients should override {@link #doSave(Writer, Map) doSave}. * </p> * @param writer the writer * @param options the save options. * @see #doSave(Writer, Map) */ public final void save(Writer writer, Map<?, ?> options) throws IOException { if (defaultSaveOptions == null || defaultSaveOptions.isEmpty()) { doSave(writer, options); } else if (options == null) { doSave(writer, defaultSaveOptions); } else { Map<Object, Object> mergedOptions = new HashMap<Object, Object>(defaultSaveOptions); mergedOptions.putAll(options); doSave(writer, mergedOptions); } setModified(false); }
/** * Saves the resource to the writer using the specified options. * <p> * This implementation is <code>final</code>; * clients should override {@link #doSave(Writer, Map) doSave}. * </p> * @param writer the writer * @param options the save options. * @see #doSave(Writer, Map) */ public final void save(Writer writer, Map<?, ?> options) throws IOException { if (defaultSaveOptions == null || defaultSaveOptions.isEmpty()) { doSave(writer, options); } else if (options == null) { doSave(writer, defaultSaveOptions); } else { Map<Object, Object> mergedOptions = new HashMap<Object, Object>(defaultSaveOptions); mergedOptions.putAll(options); doSave(writer, mergedOptions); } setModified(false); }