Package org.eclipse.m2m.atl.core.ui.vm.asm

# Class ASMModelWrapper

java.lang.Object
org.eclipse.m2m.atl.core.ui.vm.asm.ASMModelWrapper

All Implemented Interfaces:
  `IModel`, `IReferenceModel`

public class ASMModelWrapper extends Object implements IModel, IReferenceModel
The RegularVM adaptation of the `IModel`, `IReferenceModel`.

## Constructor Summary

Constructors
Constructor
Description
`ASMModelWrapper(ASMModelWrapper referenceModel, ASMFactory modelFactory, ModelLoader modelLoader, String modelName, String path, boolean newModel)`
Creates a new `ASMModelWrapper`.
`ASMModelWrapper(ASMModel asmModel, ModelLoader modelLoader)`
Creates a new `ASMModelWrapper`, with the given `ASMModel`.

## Method Summary

Modifier and Type
Method
Description
`ASMModel`
`getAsmModel()`
Returns the inner `ASMModel`.
`Set<? extends Object>`
`getElementsByType(Object metaElement)`
Deprecated.
unused in this implementation
`Object`
`getMetaElementByName(String name)`
Deprecated.
unused in this implementation
`ASMFactory`
`getModelFactory()`
Returns the ModelFactory used to create the current model.
`ModelLoader`
`getModelLoader()`
Returns the model loader that created the inner `ASMModel`.
`String`
`getName()`
Returns the inner model name or &lt;unnamed&gt;.
`IReferenceModel`
`getReferenceModel()`
Returns the `IReferenceModel` (i.e.
`boolean`
`isModelOf(Object object)`
Deprecated.
unused in this implementation
`boolean`
`isTarget()`
Defines if the model is readonly or not.
`Object`
`newElement(Object metaElement)`
Deprecated.
unused in this implementation
`void`
`setAsmModel(ASMModel asmModel)`
Sets the inner `ASMModel`.
`void`
`setIsTarget(boolean value)`
Sets if the model is readonly or not.
`void`
`setReferenceModel(ASMModelWrapper referenceModel)`
Sets the metamodel.

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

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

## Constructor Details

### ASMModelWrapper

public ASMModelWrapper(ASMModelWrapper referenceModel, ASMFactory modelFactory, ModelLoader modelLoader, String modelName, String path, boolean newModel)
Creates a new `ASMModelWrapper`.

Parameters:
  `referenceModel` - the `ASMModelWrapper` metamodel
  `modelFactory` - the model loader creating this model.
  `modelLoader` - the model loader creating the wrapped model.
  `modelName` - the model name
  `path` - the model path (injection path for an existing one, extraction path for a new one)
  `newModel` - true if the model is a new one (output model)

### ASMModelWrapper

public ASMModelWrapper(ASMModel asmModel, ModelLoader modelLoader)
Creates a new `ASMModelWrapper`, with the given `ASMModel`. This constructor is used to create metametamodels.

Parameters:
  `asmModel` - the `ASMModel`
  `modelLoader` - the `ModelLoader`

## Method Details

### getReferenceModel

public IReferenceModel getReferenceModel()
Returns the `IReferenceModel` (i.e. the metamodel).

Specified by:
  `getReferenceModel` in interface `IModel`
Returns:
  the `IReferenceModel`
See Also:
  - `IModel.getReferenceModel()`

### setReferenceModel

public void setReferenceModel(ASMModelWrapper referenceModel)
Sets the metamodel.

Parameters:
  `referenceModel` - The metamodel to set.

### getModelLoader

public ModelLoader getModelLoader()
Returns the model loader that created the inner `ASMModel`.

Returns:
  The model loader.

### getAsmModel

public ASMModel getAsmModel()
Returns the inner `ASMModel`.

Returns:
  the inner `ASMModel`.

### setAsmModel

public void setAsmModel(ASMModel asmModel)
Sets the inner `ASMModel`.

Parameters:
  `asmModel` - The inner `ASMModel` to set.

### getName

public String getName()
Returns the inner model name or &lt;unnamed&gt;.

Returns:
  the inner model name or &lt;unnamed&gt;.

### isTarget

public boolean isTarget()
Defines if the model is readonly or not.

Specified by:
  `isTarget` in interface `IModel`
Returns:
  true if the model allows writing
See Also:
  - `IModel.isTarget()`

### setIsTarget

public void setIsTarget(boolean value)
Sets if the model is readonly or not.

Specified by:
  `setIsTarget` in interface `IModel`
Parameters:
  `value` - true if the model allows writing
See Also:
  - `IModel.setIsTarget(boolean)`

### getElementsByType

public Set<? extends Object> getElementsByType(Object metaElement)
Deprecated.
unused in this implementation
Returns a `Set` of the elements matching the given type.

Specified by:
  `getElementsByType` in interface `IModel`
Parameters:
  `metaElement` - a metatype
Returns:
  a `Set` of the elements matching the given type
See Also:
  - `IModel.getElementsByType(java.lang.Object)`

### newElement

public Object newElement(Object metaElement)
Deprecated.
unused in this implementation
Creates a new element in the model.

Specified by:
  `newElement` in interface `IModel`
Parameters:
  `metaElement` - the new element metatype
Returns:
  the newly created element
See Also:
  - `IModel.newElement(java.lang.Object)`

### getMetaElementByName

public Object getMetaElementByName(String name)
Deprecated.
unused in this implementation
Returns the metaelement having the given name.

Specified by:
  `getMetaElementByName` in interface `IReferenceModel`
Parameters:
  `name` - the given name
Returns:
  the metaelement having the given name
See Also:
  - `IReferenceModel.getMetaElementByName(java.lang.String)`

### isModelOf

public boolean isModelOf(Object object)
Deprecated.
unused in this implementation
Returns true if the given object is contained in this model's resource or a referenced resource.

Specified by:
  `isModelOf` in interface `IModel`
Parameters:
  `object` - the model element
Returns:
  true if object is contained in this model's resource or a referenced resource
See Also:
  - `IModel.isModelOf(java.lang.Object)`

### getModelFactory

public ASMFactory getModelFactory()
Returns the ModelFactory used to create the current model.

Specified by:
  `getModelFactory` in interface `IModel`
Returns:
  true if the model allows writing
See Also:
  - `IModel.getModelFactory()`