Package org.eclipse.m2m.atl.core.emf

# Class EMFModelFactory

java.lang.Object
org.eclipse.m2m.atl.core.ModelFactory
org.eclipse.m2m.atl.core.emf.EMFModelFactory

public class EMFModelFactory extends ModelFactory
The EMF implementation of the `ModelFactory`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`MODEL_FACTORY_NAME`
The model factory name which is also the extractor/injector name.
`static final String`
`OPTION_CONTENT_TYPE`
Content type.
`static final String`
`OPTION_URI`
URI option.

## Constructor Summary

Constructors
Constructor
Description
`EMFModelFactory()`
Creates a new `EMFModelFactory` and initialize the `ResourceSet`.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`finalizeResource(org.eclipse.emf.ecore.resource.Resource r)`
Finalizes r.
`IReferenceModel`
`getBuiltInResource(String name)`
Returns the built-in resource matching the given name.
`String`
`getDefaultExtractorName()`
Returns a default `IExtractor` associated with the current factory.
`String`
`getDefaultInjectorName()`
Returns a default `IInjector` associated with the current factory.
`EMFReferenceModel`
`getMetametamodel()`
Returns the Metametamodel.
`org.eclipse.emf.ecore.resource.ResourceSet`
`getResourceSet()`
`EMFModel`
`newModel(EMFReferenceModel referenceModel, String uri)`
Creates a new `EMFModel` using the given uri.
`IModel`
`newModel(IReferenceModel referenceModel)`
Creates a new `IModel` using default options and conforming to the given `IReferenceModel`.
`IModel`
`newModel(IReferenceModel referenceModel, Map<String,Object> options)`
Creates a new `IModel` using specified options and conforming to the given `IReferenceModel`.
`IReferenceModel`
`newReferenceModel()`
Creates a new `IReferenceModel` using default options.
`IReferenceModel`
`newReferenceModel(Map<String,Object> options)`
Creates a new `IReferenceModel` using specified options.
`void`
`unload(EMFModel model)`
Removes the model's `Resource` from the `ResourceSet` and calls `finalizeResource(Resource)`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### MODEL_FACTORY_NAME

public static final String MODEL_FACTORY_NAME
The model factory name which is also the extractor/injector name.

See Also:
  - Constant Field Values

### OPTION_CONTENT_TYPE

public static final String OPTION_CONTENT_TYPE
Content type.

See Also:
  - Constant Field Values

### OPTION_URI

public static final String OPTION_URI
URI option.

See Also:
  - Constant Field Values

## Constructor Details

### EMFModelFactory

public EMFModelFactory()
Creates a new `EMFModelFactory` and initialize the `ResourceSet`.

## Method Details

### getMetametamodel

public EMFReferenceModel getMetametamodel()
Returns the Metametamodel.

Specified by:
  `getMetametamodel` in class `ModelFactory`
Returns:
  the Metametamodel
See Also:
  - `ModelFactory.getMetametamodel()`

### newReferenceModel

public IReferenceModel newReferenceModel(Map<String,Object> options)
Creates a new `IReferenceModel` using specified options.

Specified by:
  `newReferenceModel` in class `ModelFactory`
Parameters:
  `options` - the creation options
Returns:
  a new `IReferenceModel`
See Also:
  - `ModelFactory.newReferenceModel(java.util.Map)`

### newReferenceModel

public IReferenceModel newReferenceModel()
Creates a new `IReferenceModel` using default options.

Specified by:
  `newReferenceModel` in class `ModelFactory`
Returns:
  a new `IReferenceModel`
See Also:
  - `ModelFactory.newReferenceModel()`

### newModel

public IModel newModel(IReferenceModel referenceModel, Map<String,Object> options)
Creates a new `IModel` using specified options and conforming to the given `IReferenceModel`.

Specified by:
  `newModel` in class `ModelFactory`
Parameters:
  `referenceModel` - the `IReferenceModel`
  `options` - the creation options
Returns:
  a new `IModel`
See Also:
  - `ModelFactory.newModel(org.eclipse.m2m.atl.core.IReferenceModel, java.util.Map)`

### newModel

public IModel newModel(IReferenceModel referenceModel)
Creates a new `IModel` using default options and conforming to the given `IReferenceModel`.

Specified by:
  `newModel` in class `ModelFactory`
Parameters:
  `referenceModel` - the `IReferenceModel`
Returns:
  a new `IModel`
See Also:
  - `ModelFactory.newModel(org.eclipse.m2m.atl.core.IReferenceModel)`

### newModel

public EMFModel newModel(EMFReferenceModel referenceModel, String uri)
Creates a new `EMFModel` using the given uri.

Parameters:
  `referenceModel` - the `IReferenceModel`
  `uri` - the model uri
Returns:
  a new `IModel`

### getDefaultExtractorName

public String getDefaultExtractorName()
Returns a default `IExtractor` associated with the current factory.

Specified by:
  `getDefaultExtractorName` in class `ModelFactory`
Returns:
  the default `IExtractor`
See Also:
  - `ModelFactory.getDefaultExtractorName()`

### getDefaultInjectorName

public String getDefaultInjectorName()
Returns a default `IInjector` associated with the current factory.

Specified by:
  `getDefaultInjectorName` in class `ModelFactory`
Returns:
  the default `IInjector`
See Also:
  - `ModelFactory.getDefaultInjectorName()`

### getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()

### getBuiltInResource

public IReferenceModel getBuiltInResource(String name) throws ATLCoreException
Returns the built-in resource matching the given name.

Specified by:
  `getBuiltInResource` in class `ModelFactory`
Parameters:
  `name` - the resource name
Returns:
  the built-in resource matching the given name
Throws:
  `ATLCoreException`
See Also:
  - `ModelFactory.getBuiltInResource(java.lang.String)`

### unload

public void unload(EMFModel model)
Removes the model's `Resource` from the `ResourceSet` and calls `finalizeResource(Resource)`.

Parameters:
  `model` - The model of which to remove the `Resource`.

### finalizeResource

protected void finalizeResource(org.eclipse.emf.ecore.resource.Resource r)
Finalizes r. This implementation does nothing, but allows for overriding in subclasses.

Parameters:
  `r` - The resource to finalize.