Interface PluginAnnotationProcessor<R>

Type Parameters:
R - the result type of the processor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PluginAnnotationProcessor<R>
A centralized mechanism for processing annotations of plugin objects.
  • Method Details

    • events

      Processes the EventHandler method annotations of a given object to create event listeners. The result is an EventSubscription tied to all created event listeners. If none, an empty result is returned.
      Parameters:
      plugin - the owning plugin
      Returns:
      a new event handler processor
    • tasks

      Processes the TaskHandler method annotations of a given object to create tasks. The result is a Cancellable tied to all created tasks. If none, an empty result is returned.
      Parameters:
      plugin - the owning plugin
      Returns:
      a new task handler processor
    • triggers

      Processes the TriggerHandler method annotations of a given object to create trigger listeners. The result is an EventSubscription tied to all created trigger listeners. If none, an empty result is returned.
      Parameters:
      plugin - the owning plugin
      Returns:
      a new trigger handler processor
    • compose

      static PluginAnnotationProcessor<List<Object>> compose(PluginAnnotationProcessor<?>... processors)
      Composes multiple processors into one that returns their result in a list.
      Note that if a composed processor is in the list of processors, it will be flattened. Such as:
      compose(p1, p2, compose(p3, p4), p5) will become compose(p1, p2, p3, p4, p5)
      Parameters:
      processors - the processors
      Returns:
      the composed processor
    • compose

      Composes multiple processors into one that returns their result in a list.
      Note that if a composed processor is in the list of processors, it will be flattened. Such as:
      compose(p1, p2, compose(p3, p4), p5) will become compose(p1, p2, p3, p4, p5)
      Parameters:
      processors - the processors
      Returns:
      the composed processor
    • process

      Optional<R> process(Object instance)
      Processes the annotations of the given object.
      Parameters:
      instance - the object
      Returns:
      the result of the processing