Package org.eclipse.handly.model

## Interface IElementHandleFactory

-     public interface IElementHandleFactory

  Provides a generic way to create `IElement` handles. An instance of `IElementHandleFactory` for a model can usually be obtained via the model's `context` by `context.get(IElementHandleFactory.class)`.

  Note that, despite having a dependency on `IResource`, this interface can safely be used even when `org.eclipse.core.resources` bundle is not available. This is based on the "outward impression" of late resolution of symbolic references a JVM must provide according to the JVMS.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IElement` | `createFromHandleMemento​(java.lang.String memento)` | Returns the element handle created from the given handle memento that was generated by `Elements.getHandleMemento(IElement)`.
    `IElement` | `createFromResourceHandle​(org.eclipse.core.resources.IResource resource)` | Returns the handle of the element corresponding to the given resource.

- - ### Method Detail

    - #### createFromHandleMemento

          IElement createFromHandleMemento​(java.lang.String memento)

      Returns the element handle created from the given handle memento that was generated by `Elements.getHandleMemento(IElement)`.
      Parameters:
        `memento` - a handle memento (may be `null`)
      Returns:
        the element handle created from the given memento, or `null` if unable to create an element handle from the given memento

    - #### createFromResourceHandle

          IElement createFromResourceHandle​(org.eclipse.core.resources.IResource resource)

      Returns the handle of the element corresponding to the given resource.
      Parameters:
        `resource` - a resource handle (may be `null`)
      Returns:
        the handle of the element corresponding to the given resource, or `null` if unable to associate the given resource with an element