Service

Card Puncher Data Processing

Add the appropriate child element (<applicationService>, <projectService>or <moduleService>) to the <extensions>section of the plugin.xml file.
  • For the newly added child element, set the following attributes:
    • serviceInterface: specifies the service interface class.
    • serviceImplementation: specifies the service implementation class.
Note that the interface and implementation classes can be the same.To clarify the service declaration procedure, consider the following fragment of the plugin.xml file:
<extensions defaultExtensionNs="com.intellij">
  <!-- Declare the application level service -->
  <applicationService serviceInterface="Mypackage.MyServiceInterfaceClass" serviceImplementation="Mypackage.MyServiceImplClass" />

  <!-- Declare the project level service -->
  <projectService serviceInterface="Mypackage.MyProjectServiceInterfaceClass" serviceImplementation="Mypackage.MyProjectServiceImplClass" />
</extensions>
Get
To instantiate your service, in Java code, use the following syntax:
MyServiceImplClass service = ServiceManager.getService(MyServiceImplClass.class);
Documentation / Reference







Share this page:
Follow us:
Task Runner