Class ClassBasedExtension
java.lang.Object
org.eclipse.epsilon.common.dt.extensions.ClassBasedExtension
Class which looks up and creates the instances of the classes referred to
through the specified extension point. The extension point must declare an
attribute of type "java" and name
CLASS_PROPERTY
. Referenced
classes should implement a certain interface or inherit from a certain
class.- Version:
- 1.0
- Author:
- Antonio García-Domínguez
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClassBasedExtension
(org.eclipse.core.runtime.IConfigurationElement configElement, Class<?> expectedClass) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionInstantiates the referenced class.Returns the fully qualified class name of the referenced class, as set in the extension.static <T> List<T>
getImplementations
(String extensionPointID, Class<T> expectedClass) Returns a list with instances of the classes registered in the available extensions for this extension point.static List<ClassBasedExtension>
getInstances
(String extensionPointID, Class<?> expectedClass) Returns a list with the available extensions for this extension point.
-
Field Details
-
CLASS_PROPERTY
- See Also:
-
-
Constructor Details
-
ClassBasedExtension
public ClassBasedExtension(org.eclipse.core.runtime.IConfigurationElement configElement, Class<?> expectedClass) Creates a new instance.- Parameters:
configElement
- Configuration element from the extension element.expectedClass
- Superclass or interface to which the referenced class should comply.
-
-
Method Details
-
getInstances
public static List<ClassBasedExtension> getInstances(String extensionPointID, Class<?> expectedClass) Returns a list with the available extensions for this extension point. -
getImplementations
public static <T> List<T> getImplementations(String extensionPointID, Class<T> expectedClass) throws IllegalExtensionException Returns a list with instances of the classes registered in the available extensions for this extension point.- Throws:
IllegalExtensionException
-
getClassName
Returns the fully qualified class name of the referenced class, as set in the extension. -
createInstance
Instantiates the referenced class.- Throws:
IllegalExtensionException
-