Package org.eclipse.emf.compare.ide.hook

# Class AbstractResourceSetHooks

java.lang.Object
org.eclipse.emf.compare.ide.hook.AbstractResourceSetHooks

All Implemented Interfaces:
  `IResourceSetHook`

public abstract class AbstractResourceSetHooks extends Object implements IResourceSetHook
Abstract implementation of `IResourceSetHook`.

Since:
  3.2

## Constructor Summary

Constructors
Constructor
Description
`AbstractResourceSetHooks()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isHookFor(Collection<? extends URI> uris)`
Returns true if this hook should be used.
`void`
`onDispose(Iterable<Resource> resources)`
This will be called when the resource set is disposed (if it is).
`void`
`postLoadingHook(ResourceSet resourceSet, Collection<? extends URI> uris)`
This will be called after the resource set is populated in an unspecified order.
`void`
`preLoadingHook(ResourceSet resourceSet, Collection<? extends URI> uris)`
This will be called before the final resource set is populated, in unspecified order.

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

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

## Constructor Details

### AbstractResourceSetHooks

public AbstractResourceSetHooks()

## Method Details

### isHookFor

public boolean isHookFor(Collection<? extends URI> uris)
Returns true if this hook should be used.

Specified by:
  `isHookFor` in interface `IResourceSetHook`
Parameters:
  `uris` - list of `URI`s about to be loaded in the `ResourceSet`.
Returns:
  `true` if this hook should be used, `false` otherwise.
See Also:
  - `IResourceSetHook.isHookFor(java.util.Collection)`

### preLoadingHook

public void preLoadingHook(ResourceSet resourceSet, Collection<? extends URI> uris)
This will be called before the final resource set is populated, in unspecified order. Resource set hooks can load resource in this resource set and thus an individual hook is not guaranteed to be provided an empty resource set here.

Specified by:
  `preLoadingHook` in interface `IResourceSetHook`
Parameters:
  `resourceSet` - about to be filled.
  `uris` - `URI`s that the resource set has been requested to load. The `Collection` of `URI` is not modifiable.
See Also:
  - `IResourceSetHook.preLoadingHook(org.eclipse.emf.ecore.resource.ResourceSet, java.util.Collection)`

### postLoadingHook

public void postLoadingHook(ResourceSet resourceSet, Collection<? extends URI> uris)
This will be called after the resource set is populated in an unspecified order.

Specified by:
  `postLoadingHook` in interface `IResourceSetHook`
Parameters:
  `resourceSet` - that has been filled with `Resource`s.
  `uris` - `URI`s that the resource set has been requested to load.The `Collection` of `URI` is not modifiable.
See Also:
  - `IResourceSetHook.postLoadingHook(org.eclipse.emf.ecore.resource.ResourceSet, java.util.Collection)`

### onDispose

public void onDispose(Iterable<Resource> resources)
This will be called when the resource set is disposed (if it is).

By default, EMF Compare will not unload any resource. Still some resources might need to be unloaded. This method could be a good way to do it. Hooks are called in unspecified order, so resources may already have been unloaded by other hooks when yours is called.

Specified by:
  `onDispose` in interface `IResourceSetHook`
Parameters:
  `resources` - List of `Resource`s currently in the resource set.
See Also:
  - `IResourceSetHook.onDispose(java.lang.Iterable)`