BrightSide Workbench Full Report + Source Code
org.turro.action.Plugins Class Reference

Static Public Member Functions

static Map< String, Object > execute (String name, Map params)
 
static< T > T loadImplementation (Class< T > jclass)
 
static< T > T loadImplementation (Class< T > jclass, String label)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 36 of file Plugins.java.

Member Function Documentation

◆ execute()

static Map<String, Object> org.turro.action.Plugins.execute ( String  name,
Map  params 
)
static

Definition at line 44 of file Plugins.java.

44  {
45  loadPlugins();
46  Map<String, Object> results = new HashMap<>();
47  for(IElephantPlugin iPlugin : _plugins) {
48  if(iPlugin.itsMe(name)) {
49  iPlugin.setContext(params, results);
50  iPlugin.execute();
51  if(iPlugin.stopPropagating()) break;
52  }
53  }
54  return results;
55  }
Here is the caller graph for this function:

◆ loadImplementation() [1/2]

static <T> T org.turro.action.Plugins.loadImplementation ( Class< T >  jclass)
static

Definition at line 57 of file Plugins.java.

57  {
58  return loadImplementation(jclass, null);
59  }
static< T > T loadImplementation(Class< T > jclass)
Definition: Plugins.java:57
Here is the caller graph for this function:

◆ loadImplementation() [2/2]

static <T> T org.turro.action.Plugins.loadImplementation ( Class< T >  jclass,
String  label 
)
static

Definition at line 61 of file Plugins.java.

61  {
62  loadPlugins();
63  for(Class pclass : _pluginClass) {
64  if(Reflections.of(pclass).canCast(jclass)) {
65  if(Strings.isBlank(label) ||
66  ((ElephantPlugin) pclass.getAnnotation(ElephantPlugin.class)).label().equals(label)) {
67  return (T) Reflections.of(pclass).instance();
68  }
69  }
70  }
71  return null;
72  }

The documentation for this class was generated from the following file: