/** * Saves the resource to the writer using the specified options. * @param writer the writer * @param options the save options. */ 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. * @param writer the writer * @param options the save options. */ 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); }
@Override protected void doSave(OutputStream os, Map<?, ?> options) throws IOException { if (os instanceof URIConverter.WriteableOutputStream) { doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options); } else { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(os, document, options); } } }
@Override protected void doSave(OutputStream os, Map<?, ?> options) throws IOException { if (os instanceof URIConverter.WriteableOutputStream) { doSave(((URIConverter.WriteableOutputStream)os).asWriter(), options); } else { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { Document document = xsdSchema.getDocument(); if (document == null) { xsdSchema.updateDocument(); document = xsdSchema.getDocument(); } if (xsdSchema.getElement() == null) { xsdSchema.updateElement(); } doSerialize(os, document, options); } } }