Package org.eclipse.graphiti.features

# Interface IMappingProvider

All Known Subinterfaces:
  `IFeatureProvider`

All Known Implementing Classes:
  `AbstractFeatureProvider`, `ConfigurableFeatureProviderWrapper`, `DefaultFeatureProvider`, `DefaultFeatureProviderWithPatterns`, `DefaultFeatureProviderWrapper`

public interface IMappingProvider
The Interface IMappingProvider.

## Method Summary

Modifier and Type
Method
Description
`Object[]`
`getAllBusinessObjectsForPictogramElement(PictogramElement pictogramElement)`
Returns all business objects which are linked to the given pictogram element.
`PictogramElement[]`
`getAllPictogramElementsForBusinessObject(Object businessObject)`
Provides the pictogram elements which represents the given business object.
`Object`
`getBusinessObjectForPictogramElement(PictogramElement pictogramElement)`
Returns the first of possibly several business objects which are linked to the given pictogram element.
`PictogramElement`
`getPictogramElementForBusinessObject(Object businessObject)`
This method is similar to the method getAllPictogramElementsForBusinessObject, but only return the first PictogramElement.
`boolean`
`hasPictogramElementForBusinessObject(Object businessObject)`
Check does there have pictogram element linked to this business object.
`void`
`link(PictogramElement pictogramElement, Object businessObject)`
Links the pictogram element with a business object.
`void`
`link(PictogramElement pictogramElement, Object[] businessObjects)`
Links the pictogram element with several business objects.

## Method Details

### getAllBusinessObjectsForPictogramElement

Object[] getAllBusinessObjectsForPictogramElement(PictogramElement pictogramElement)
Returns all business objects which are linked to the given pictogram element. Equality is determined by calling the `EcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)` method, but this might be changed by clients by overriding `IToolBehaviorProvider.equalsBusinessObjects(Object, Object)`.

Parameters:
  `pictogramElement` - The pictogram element for which to return the business objects.
Returns:
  The business objects which are linked to the given pictogram element. Can be empty but not null.
See Also:
  - `link(PictogramElement, Object[])`

### getBusinessObjectForPictogramElement

Object getBusinessObjectForPictogramElement(PictogramElement pictogramElement)
Returns the first of possibly several business objects which are linked to the given pictogram element. Equality is determined by calling the `EcoreUtil.equals(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)` method, but this might be changed by clients by overriding `IToolBehaviorProvider.equalsBusinessObjects(Object, Object)`. This is a convenience method for `getAllBusinessObjectsForPictogramElement(PictogramElement)`, because in many usecases only a single business object is linked.

Parameters:
  `pictogramElement` - The pictogram element for which to return the business object.
Returns:
  The first of possibly several business objects which are linked to the given pictogram element. Can be null.
See Also:
  - `link(PictogramElement, Object)`

### getAllPictogramElementsForBusinessObject

PictogramElement[] getAllPictogramElementsForBusinessObject(Object businessObject)
Provides the pictogram elements which represents the given business object.

Parameters:
  `businessObject` - the given business object
Returns:
  the pictogram elements

### link

void link(PictogramElement pictogramElement, Object businessObject)
Links the pictogram element with a business object. This deletes all previous links of this pictogram element.

Parameters:
  `pictogramElement` - The pictogram element which to link to a new business object.
  `businessObject` - The business object to link. Can be null to just delete previous links.

### link

void link(PictogramElement pictogramElement, Object[] businessObjects)
Links the pictogram element with several business objects. This deletes all previous links of this pictogram element.

Parameters:
  `pictogramElement` - The pictogram element which to link to new business objects.
  `businessObjects` - The business objects to link. Can be null or empty to just delete previous links.

### hasPictogramElementForBusinessObject

boolean hasPictogramElementForBusinessObject(Object businessObject)
Check does there have pictogram element linked to this business object.

Parameters:
  `businessObject` - the business object
Returns:
  true when at least one pictogram element is linked, otherwise return false.

### getPictogramElementForBusinessObject

PictogramElement getPictogramElementForBusinessObject(Object businessObject)
This method is similar to the method getAllPictogramElementsForBusinessObject, but only return the first PictogramElement.

Parameters:
  `businessObject` - the business object
Returns:
  linked pictogram element
See Also:
  - `getAllPictogramElementsForBusinessObject(Object)`