public abstract class AbstractModelConverter extends java.lang.Object implements IModelConverter
OPTION_RESOURCE_VERSION_DESCRIPTOR
Constructor and Description |
---|
AbstractModelConverter() |
Modifier and Type | Method and Description |
---|---|
void |
addExtraAttributesToSavedRootElement(org.eclipse.emf.ecore.xmi.impl.XMLString rootElement,
java.util.Map<?,?> options)
Provides a hook for adding additional attributes to the model root element during the save operation for
specified resource.
|
org.xml.sax.InputSource |
convertLoad(org.eclipse.emf.ecore.xmi.XMLResource resource,
java.io.InputStream inputStream,
java.util.Map<?,?> options)
Creates an
InputSource from given InputStream during the load operation for specified resource. |
protected abstract void |
convertLoadElement(org.jdom.Element element,
java.util.Map<?,?> options) |
void |
convertSave(org.eclipse.emf.ecore.xmi.impl.XMLString xml,
int flushThreshold,
org.eclipse.emf.common.util.URI uri,
java.io.OutputStream outputStream,
java.lang.String encoding,
org.eclipse.emf.ecore.xmi.XMLHelper helper,
java.util.Map<?,?> options)
During a save operation, writes to given
OutputStream with specified encoding the content of given
XMLString , using the XMLHelper . |
protected abstract void |
convertSaveElement(org.jdom.Element element,
java.util.Map<?,?> options) |
void |
dispose() |
protected java.io.InputStream |
doConvertLoad(org.eclipse.emf.ecore.xmi.XMLResource resource,
java.io.InputStream inputStream,
java.util.Map<?,?> options) |
abstract java.lang.Object |
getResourceVersionFromPreferences(org.eclipse.core.resources.IProject project) |
boolean |
isLoadConverterFor(org.eclipse.emf.ecore.xmi.XMLResource resource,
java.util.Map<?,?> options)
During a load operation, returns
true if this converter applies to given XMLResource, taking into
account that the in memory meta-model defines given descriptor. |
boolean |
isSaveConverterFor(org.eclipse.emf.ecore.xmi.XMLResource resource,
java.util.Map<?,?> options)
During a save operation, returns true if this converter applies to given XMLResource.
|
protected org.jdom.input.SAXBuilder |
makeBuilder() |
protected org.xml.sax.helpers.DefaultHandler |
makeDefaultHandler(org.eclipse.emf.ecore.xmi.XMLResource resource,
java.util.Map<?,?> options) |
protected org.eclipse.emf.ecore.xmi.XMIException |
toXMIException(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.Exception ex) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetaModelVersionDescriptor, getResourceVersionDescriptor
public abstract java.lang.Object getResourceVersionFromPreferences(org.eclipse.core.resources.IProject project)
public boolean isLoadConverterFor(org.eclipse.emf.ecore.xmi.XMLResource resource, java.util.Map<?,?> options)
IModelConverter
true
if this converter applies to given XMLResource, taking into
account that the in memory meta-model defines given descriptor.isLoadConverterFor
in interface IModelConverter
resource
- The resource that might eventually be converted.options
- The load options.public boolean isSaveConverterFor(org.eclipse.emf.ecore.xmi.XMLResource resource, java.util.Map<?,?> options)
IModelConverter
isSaveConverterFor
in interface IModelConverter
resource
- The resource that might eventually be converted.options
- The save options.protected org.eclipse.emf.ecore.xmi.XMIException toXMIException(org.eclipse.emf.ecore.resource.Resource resource, java.lang.Exception ex)
public org.xml.sax.InputSource convertLoad(org.eclipse.emf.ecore.xmi.XMLResource resource, java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException
IModelConverter
InputSource
from given InputStream
during the load operation for specified resource.convertLoad
in interface IModelConverter
resource
- The resource being loaded.inputStream
- The InputStream
being read from.options
- The load options.InputSource
that may be later processed by the parser.java.io.IOException
protected java.io.InputStream doConvertLoad(org.eclipse.emf.ecore.xmi.XMLResource resource, java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException, org.jdom.JDOMException
java.io.IOException
org.jdom.JDOMException
protected org.jdom.input.SAXBuilder makeBuilder()
protected org.xml.sax.helpers.DefaultHandler makeDefaultHandler(org.eclipse.emf.ecore.xmi.XMLResource resource, java.util.Map<?,?> options)
protected abstract void convertLoadElement(org.jdom.Element element, java.util.Map<?,?> options)
public void convertSave(org.eclipse.emf.ecore.xmi.impl.XMLString xml, int flushThreshold, org.eclipse.emf.common.util.URI uri, java.io.OutputStream outputStream, java.lang.String encoding, org.eclipse.emf.ecore.xmi.XMLHelper helper, java.util.Map<?,?> options) throws java.io.IOException
IModelConverter
OutputStream
with specified encoding the content of given
XMLString
, using the XMLHelper
.convertSave
in interface IModelConverter
xml
- The XML content to be converted.flushThreshold
- The number of bytes to write before the outputStream is flushed.uri
- The URI to which the converted XML content will be written.outputStream
- The stream into which the converted XML data will be written.encoding
- The encoding to use in the outputStream.helper
- The XMLHelper.options
- The save options.java.io.IOException
PipedOutputStream
protected abstract void convertSaveElement(org.jdom.Element element, java.util.Map<?,?> options)
public void addExtraAttributesToSavedRootElement(org.eclipse.emf.ecore.xmi.impl.XMLString rootElement, java.util.Map<?,?> options)
IModelConverter
addExtraAttributesToSavedRootElement
in interface IModelConverter
rootElement
- The XMLString
to write to, using doc.addAttribute.options
- The save options.XMLResource.getDefaultSaveOptions()
public void dispose()
dispose
in interface IModelConverter