Interface IDynamicTargetPlugin

All Superinterfaces:
IPlugin
All Known Subinterfaces:
IUnitContribution, IUnitInterpreter

public interface IDynamicTargetPlugin extends IPlugin
A dynamic target plugin is a special type of plugin that takes one or more units as input and provide augmentation for those units. Currently, the JEB back-end supports two types of dynamic target plugins:

External plugins implementing this interface must have a no-argument constructor.

Life-cycle information. Unlike standard JEB unit plugins, that decouple the identification from the business logic, dynamic-target plugins specify the identification and processing details within a single interface (the primary reason behind this design choice being ease of development, in particular for contribution plugins written as Python scripts). Therefore, multiple dynamic-target plugins can be (and generally, are) instantiated:
- One first instance serves as for identification purpose only: its isTarget(IUnit) method is used to determine is a given unit is a candidate for the plugin;
- On a successful identification, a new plugin object is instantiated and registered with its target unit; the primary target unit is set using setPrimaryTarget(IUnit).

  • Method Details

    • isTarget

      boolean isTarget(IUnit unit)
      Determine if a provided unit is an intended target for this plugin.
      Parameters:
      unit - the intended target
      Returns:
      true if the provided unit is a target
    • setPrimaryTarget

      void setPrimaryTarget(IUnit unit)
      Set the primary target for this plugin. This method should not be called by client code. The JEB back-end is calling this method when initializing a dynamic target plugin.
      Parameters:
      unit - the primary target unit
    • getPrimaryTarget

      IUnit getPrimaryTarget()
      Retrieve the primary target for this plugin. If called before the plugin has been initialized by the JEB back-end, this method should return null.
      Returns:
      the primary target unit, or null if it has not been set yet