# Class AbstractCodeMiningProvider

java.lang.Object
org.eclipse.jface.text.codemining.AbstractCodeMiningProvider

All Implemented Interfaces:
  `ICodeMiningProvider`

public abstract class AbstractCodeMiningProvider extends Object implements ICodeMiningProvider
A codemining provider that can provide adapters through a context that can be set by the creator of this codemining provider.

Clients may subclass.

Since:
  3.13

## Constructor Summary

Constructors
Constructor
Description
`AbstractCodeMiningProvider()`

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
Dispose code mining provider.
`protected final <T> T`
`getAdapter(Class<T> adapterClass)`
Returns an object which is an instance of the given class and provides additional context for this codemining provider.
`final void`
`setContext(IAdaptable context)`
Sets this codemining provider's context which is responsible to provide the adapters.

### Methods inherited from class Object

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

### Methods inherited from interface ICodeMiningProvider

`provideCodeMinings`

## Constructor Details

### AbstractCodeMiningProvider

public AbstractCodeMiningProvider()

## Method Details

### setContext

public final void setContext(IAdaptable context) throws IllegalStateException, IllegalArgumentException
Sets this codemining provider's context which is responsible to provide the adapters.

Parameters:
  `context` - the context for this codemining provider
Throws:
  `IllegalArgumentException` - if the context is `null`
  `IllegalStateException` - if this method is called more than once

### dispose

public void dispose()
Description copied from interface: `ICodeMiningProvider`
Dispose code mining provider.

Specified by:
  `dispose` in interface `ICodeMiningProvider`

### getAdapter

protected final <T> T getAdapter(Class<T> adapterClass)
Returns an object which is an instance of the given class and provides additional context for this codemining provider.

Parameters:
  `adapterClass` - the adapter class to look up
Returns:
  an instance that can be cast to the given class, or `null` if this object does not have an adapter for the given class