Class PluginAggregator

java.lang.Object
org.mybatis.generator.api.CompositePlugin
org.mybatis.generator.internal.PluginAggregator
All Implemented Interfaces:
Plugin

public final class PluginAggregator extends CompositePlugin
This class is for internal use only. It contains a list of plugins for the current context and is used to aggregate plugins together. This class implements the rule that if any plugin returns "false" from a method, then no subsequent plugin is called.

This class does not follow the normal plugin lifecycle and should not be subclassed by clients.

Author:
Jeff Butler
  • Constructor Details

    • PluginAggregator

      public PluginAggregator()
  • Method Details

    • setContext

      public void setContext(Context context)
      Description copied from interface: Plugin
      Set the context under which this plugin is running.
      Specified by:
      setContext in interface Plugin
      Overrides:
      setContext in class CompositePlugin
      Parameters:
      context - the new context
    • setProperties

      public void setProperties(Properties properties)
      Description copied from interface: Plugin
      Set properties from the plugin configuration.
      Specified by:
      setProperties in interface Plugin
      Overrides:
      setProperties in class CompositePlugin
      Parameters:
      properties - the new properties
    • validate

      public boolean validate(List<String> warnings)
      Description copied from interface: Plugin
      This method is called after all the setXXX methods are called, but before any other method is called. This allows the plugin to determine whether it can run or not. For example, if the plugin requires certain properties to be set, and the properties are not set, then the plugin is invalid and will not run.
      Parameters:
      warnings - add strings to this list to specify warnings. For example, if the plugin is invalid, you should specify why. Warnings are reported to users after the completion of the run.
      Returns:
      true if the plugin is in a valid state. Invalid plugins will not be called