Package org.eclipse.m2m.atl.core

# Interface IModel

All Known Subinterfaces:
  `IReferenceModel`

All Known Implementing Classes:
  `ASMModelWrapper`, `AtlResourceImpl.EMFModelWrapper`, `EMFModel`, `EMFReferenceModel`

public interface IModel
The IModel interface defines a model managed by any framework.

## Method Summary

Modifier and Type
Method
Description
`Set<? extends Object>`
`getElementsByType(Object metaElement)`
Returns a `Set` of the elements matching the given type.
`ModelFactory`
`getModelFactory()`
Returns the ModelFactory used to create the current model.
`IReferenceModel`
`getReferenceModel()`
Returns the `IReferenceModel` (i.e.
`boolean`
`isModelOf(Object object)`
Returns true if the given object is contained in this model's resource or a referenced resource.
`boolean`
`isTarget()`
Defines if the model is readonly or not.
`Object`
`newElement(Object metaElement)`
Creates a new element in the model.
`void`
`setIsTarget(boolean value)`
Sets if the model is readonly or not.

## Method Details

### newElement

Object newElement(Object metaElement)
Creates a new element in the model.

Parameters:
  `metaElement` - the new element metatype
Returns:
  the newly created element

### getReferenceModel

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

Returns:
  the `IReferenceModel`

### getElementsByType

Set<? extends Object> getElementsByType(Object metaElement)
Returns a `Set` of the elements matching the given type.

Parameters:
  `metaElement` - a metatype
Returns:
  a `Set` of the elements matching the given type

### isTarget

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

Returns:
  true if the model allows writing

### setIsTarget

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

Parameters:
  `value` - true if the model allows writing

### getModelFactory

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

Returns:
  true if the model allows writing

### isModelOf

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

Parameters:
  `object` - the model element
Returns:
  true if object is contained in this model's resource or a referenced resource