com.sodius.mdw.core.model.emf
Class EMFXMIModelWriter

java.lang.Object
  extended by com.sodius.mdw.core.model.emf.EMFModelWriter
      extended by com.sodius.mdw.core.model.emf.EMFXMIModelWriter
All Implemented Interfaces:
ModelWriter

public class EMFXMIModelWriter
extends EMFModelWriter

Default EMF based implementation to handle XMI uris. This implementation is able to deal with XMI versions from 1.0 to 2.1.


Field Summary
static String PROPERTY_XMI_VERSION
          Name of the property that specifies the expected XMI version.
 
Fields inherited from class com.sodius.mdw.core.model.emf.EMFModelWriter
MDW_CONNECTOR_CONTEXT
 
Constructor Summary
EMFXMIModelWriter()
           
 
Method Summary
protected  Map<String,Object> createOptions(ConnectorContext context)
          Registers UTF-8 as the default encoding to use.
protected  Resource createResource(URI uri, ConnectorContext context)
          This implementation creates a resource to handle XMI based on the XMI version specified in the connector descriptor properties.
 
Methods inherited from class com.sodius.mdw.core.model.emf.EMFModelWriter
getDirectContents, logError, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_XMI_VERSION

public static final String PROPERTY_XMI_VERSION
Name of the property that specifies the expected XMI version. This property is mandatory.

See Also:
Constant Field Values
Constructor Detail

EMFXMIModelWriter

public EMFXMIModelWriter()
Method Detail

createResource

protected Resource createResource(URI uri,
                                  ConnectorContext context)
This implementation creates a resource to handle XMI based on the XMI version specified in the connector descriptor properties. This method fails if the XMI version property is not set.

Specified by:
createResource in class EMFModelWriter
Parameters:
uri - the URI to write.
context - the context in which the connector runs
Returns:
the created resource.
See Also:
PROPERTY_XMI_VERSION

createOptions

protected Map<String,Object> createOptions(ConnectorContext context)
Registers UTF-8 as the default encoding to use.

Overrides:
createOptions in class EMFModelWriter
Parameters:
context - the context in which the connector runs
Returns:
the options to pass to the resource.