/** * Creates an XMLResourceImpl and returns it. */ @Override public Resource createResource(URI uri) { return new XMLResourceImpl(uri); } }
@Override protected void attachedHelper(EObject eObject) { super.attachedHelper(eObject); if (useIDs()) { String id = getID(eObject); if (useUUIDs() && id == null) { if (assignIDsWhileLoading() || !isLoading()) { id = DETACHED_EOBJECT_TO_ID_MAP.remove(eObject); if (id == null) { id = EcoreUtil.generateUUID(); } setID(eObject, id); } } else if (id != null) { getIDToEObjectMap().put(id, eObject); } } }
/** * @since 2.7 */ protected XMLLoad createXMLLoad(Map<?, ?> options) { return createXMLLoad(); }
/** * 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); }
uriHandler.setBaseURI(getURI()); EObjectInputStream eObjectInputStream = createEObjectInputStream(inputStream, options, uriHandler); ResourceHandler handler = (ResourceHandler)options.get(OPTION_RESOURCE_HANDLER); if (handler != null) setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString()); XMLLoad xmlLoad = createXMLLoad(options);
uriHandler.setBaseURI(getURI()); EObjectOutputStream eObjectOutputStream = createEObjectOutputStream(outputStream, options, version, uriHandler); eObjectOutputStream.saveResource(this); XMLSave xmlSave = createXMLSave(options);
/** * @since 2.7 */ protected XMLSave createXMLSave(Map<?, ?> options) { return createXMLSave(); }
protected XMLSave createXMLSave() { return new XMLSaveImpl(createXMLHelper()); }
uriHandler.setBaseURI(getURI()); EObjectInputStream eObjectInputStream = createEObjectInputStream(inputStream, options, uriHandler); ResourceHandler handler = (ResourceHandler)options.get(OPTION_RESOURCE_HANDLER); if (handler != null) setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString()); XMLLoad xmlLoad = createXMLLoad(options);
uriHandler.setBaseURI(getURI()); EObjectOutputStream eObjectOutputStream = createEObjectOutputStream(outputStream, options, version, uriHandler); eObjectOutputStream.saveResource(this); XMLSave xmlSave = createXMLSave(options);
/** * @since 2.7 */ protected XMLSave createXMLSave(Map<?, ?> options) { return createXMLSave(); }
/** * 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); }
protected XMLLoad createXMLLoad() { return new XMLLoadImpl(createXMLHelper()); }
@Override protected void attachedHelper(EObject eObject) { super.attachedHelper(eObject); if (useIDs()) { String id = getID(eObject); if (useUUIDs() && id == null) { if (assignIDsWhileLoading() || !isLoading()) { id = DETACHED_EOBJECT_TO_ID_MAP.remove(eObject); if (id == null) { id = EcoreUtil.generateUUID(); } setID(eObject, id); } } else if (id != null) { getIDToEObjectMap().put(id, eObject); } } }
/** * @since 2.7 */ protected XMLLoad createXMLLoad(Map<?, ?> options) { return createXMLLoad(); }
public void doSave(Writer writer, Map<?, ?> options) throws IOException { XMLSave xmlSave = createXMLSave(options); if (options == null) { options = Collections.EMPTY_MAP; } xmlSave.save(this, writer, options); }
/** * Creates an XMLResourceImpl and returns it. */ @Override public Resource createResource(URI uri) { return new XMLResourceImpl(uri); } }