Package org.eclipse.emf.compare.rcp.extension

# Class PluginClassDescriptor<T>

java.lang.Object
org.eclipse.emf.compare.rcp.extension.PluginClassDescriptor<T>

Type Parameters:
  `T` - Type of the instances created from this descriptor.

Direct Known Subclasses:
  `EqualityHelperExtensionProviderDescriptorRCPImpl`, `PostProcessorDescriptor`, `WeightProviderDescriptorRCPImpl`

public class PluginClassDescriptor<T> extends Object
Simple utility class to create proxy of extension that are `instantiable`.

No test of the `validity` of the wrapped `IConfigurationElement` is performed. As such you should always extend this class while listening to the `IExtensionRegistry` and react properly the removal of the wrapped `IConfigurationElement`.

Note: this is based on `org.eclipse.emf.ecore.plugin.RegistryReader.PluginClassDescriptor`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`attributeName`
The name of the attribute that holds the class full name to be instantiated.
`protected org.eclipse.core.runtime.IConfigurationElement`
`element`
The element from which create an instance.

## Constructor Summary

Constructors
Constructor
Description
`PluginClassDescriptor(org.eclipse.core.runtime.IConfigurationElement element, String attributeName)`
Creates a new descriptor for given element keeping the class name to be instantiated in an attribute named `attributeName`.

## Method Summary

Modifier and Type
Method
Description
`protected T`
`createInstance()`
Creates a new instance.

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

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

## Field Details

### element

protected org.eclipse.core.runtime.IConfigurationElement element
The element from which create an instance.

### attributeName

protected String attributeName
The name of the attribute that holds the class full name to be instantiated.

## Constructor Details

### PluginClassDescriptor

public PluginClassDescriptor(org.eclipse.core.runtime.IConfigurationElement element, String attributeName)
Creates a new descriptor for given element keeping the class name to be instantiated in an attribute named `attributeName`.

Parameters:
  `element` - The element from which create an instance.
  `attributeName` - The name of the attribute that holds the class full name to be instantiated.

## Method Details

### createInstance

protected T createInstance()
Creates a new instance.

Returns:
  the new instance.
Throws:
  `RuntimeException` - wraps a CoreException if an instance of the executable extension could not be created for any reason.