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

# Class EMFInjector

java.lang.Object
org.eclipse.m2m.atl.core.emf.EMFInjector

All Implemented Interfaces:
  `IInjector`

public class EMFInjector extends Object implements IInjector
The EMF implementation of the `IInjector` interface.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`OPTION_LOAD_ON_DEMAND`
EMF loadOnDemand option.

## Constructor Summary

Constructors
Constructor
Description
`EMFInjector()`

## Method Summary

Modifier and Type
Method
Description
`void`
`inject(IModel targetModel, InputStream source, Map<String,Object> options)`
Injects data into an IModel using the given options.
`void`
`inject(IModel targetModel, Reader source, Map<String,Object> options)`
Injects data into an IModel using the given options.
`void`
`inject(IModel targetModel, String source)`
Injects data into an IModel using default options.
`void`
`inject(IModel targetModel, String source, Map<String,Object> options)`
Injects data into an IModel using the given options.
`void`
`inject(IModel targetModel, org.eclipse.emf.ecore.resource.Resource mainResource)`
Injects data into an IModel from a `Resource`.

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

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

## Field Details

### OPTION_LOAD_ON_DEMAND

public static final String OPTION_LOAD_ON_DEMAND
EMF loadOnDemand option.

See Also:
  - Constant Field Values

## Constructor Details

### EMFInjector

public EMFInjector()

## Method Details

### inject

public void inject(IModel targetModel, String source, Map<String,Object> options) throws ATLCoreException
Injects data into an IModel using the given options. Below the source parameter semantic.

- File system Resource: `file:/path`
- EMF `URI`: `uri`
- pathmap: `pathmap:path`
- Workspace Resource: `platform:/resource/path`
- Plug-in Resource: `platform:/plugin/path`

Specified by:
  `inject` in interface `IInjector`
Parameters:
  `targetModel` - the IModel where to inject
  `source` - the source indication to load the sourceModel: an URL, or a specific thing
  `options` - the injection parameters
Throws:
  `ATLCoreException`
See Also:
  - `IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.lang.String, java.util.Map)`

### inject

public void inject(IModel targetModel, String source) throws ATLCoreException
Injects data into an IModel using default options.

Specified by:
  `inject` in interface `IInjector`
Parameters:
  `targetModel` - the IModel where to inject
  `source` - the source indication to load the sourceModel
Throws:
  `ATLCoreException`
See Also:
  - `IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.lang.String)`

### inject

public void inject(IModel targetModel, InputStream source, Map<String,Object> options) throws ATLCoreException
Injects data into an IModel using the given options.

Specified by:
  `inject` in interface `IInjector`
Parameters:
  `targetModel` - the IModel where to inject
  `source` - the `InputStream` containing the model
  `options` - the injection parameters
Throws:
  `ATLCoreException`
See Also:
  - `IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.io.InputStream, java.util.Map)`

### inject

public void inject(IModel targetModel, Reader source, Map<String,Object> options) throws ATLCoreException
Injects data into an IModel using the given options.

Specified by:
  `inject` in interface `IInjector`
Parameters:
  `targetModel` - the IModel where to inject
  `source` - the `Reader` containing the model
  `options` - the injection parameters
Throws:
  `ATLCoreException`
See Also:
  - `IInjector.inject(org.eclipse.m2m.atl.core.IModel, java.io.Reader, java.util.Map)`

### inject

public void inject(IModel targetModel, org.eclipse.emf.ecore.resource.Resource mainResource)
Injects data into an IModel from a `Resource`.

Parameters:
  `targetModel` - the IModel where to inject
  `mainResource` - the main Resource