Class ExecutableExtension<T>

  • Type Parameters:
    T - the type of the object created

    public class ExecutableExtension<T>
    extends java.lang.Object
    A wrapper class that delays instantiation of classes until they're needed to prevent early plug-in loading.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.core.runtime.IConfigurationElement element  
      private T object  
      private java.lang.String propertyName  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutableExtension​(org.eclipse.core.runtime.IConfigurationElement element, java.lang.String propertyName)  
      ExecutableExtension​(T object)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T create()
      Creates a new object.
      T get()
      Get the object instantiating it if necessary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • element

        private org.eclipse.core.runtime.IConfigurationElement element
      • propertyName

        private java.lang.String propertyName
      • object

        private T object
    • Constructor Detail

      • ExecutableExtension

        public ExecutableExtension​(org.eclipse.core.runtime.IConfigurationElement element,
                                   java.lang.String propertyName)
      • ExecutableExtension

        public ExecutableExtension​(T object)
    • Method Detail

      • get

        public T get()
              throws org.eclipse.core.runtime.CoreException
        Get the object instantiating it if necessary.
        Returns:
        object
        Throws:
        org.eclipse.core.runtime.CoreException
      • create

        public T create()
                 throws org.eclipse.core.runtime.CoreException
        Creates a new object. Can't be done if you've done a get already.
        Returns:
        a new object from the extension or null if get was called earlier
        Throws:
        org.eclipse.core.runtime.CoreException