BrightSide Workbench Full Report + Source Code
org.turro.action.content.AbstractContentProvider Class Referenceabstract
Inheritance diagram for org.turro.action.content.AbstractContentProvider:
Collaboration diagram for org.turro.action.content.AbstractContentProvider:

Public Member Functions

List< String > getHelpCommands ()
 
boolean itsMe (String command)
 
ContentRenderer loadCommand (String command, IContact contact, String idContext)
 
abstract ContentRenderer loadCommand (MacroCommand macroCommand, IContact contact, String idContext)
 
List< MacroCommand > getCommands ()
 

Protected Attributes

final List< MacroCommand > commands = new ArrayList<>()
 

Detailed Description

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

Definition at line 34 of file AbstractContentProvider.java.

Member Function Documentation

◆ getCommands()

List<MacroCommand> org.turro.action.content.AbstractContentProvider.getCommands ( )

Implements org.turro.action.content.IContentProvider.

Definition at line 70 of file AbstractContentProvider.java.

70  {
71  return commands;
72  }

◆ getHelpCommands()

List<String> org.turro.action.content.AbstractContentProvider.getHelpCommands ( )

Implements org.turro.action.content.IContentProvider.

Definition at line 39 of file AbstractContentProvider.java.

39  {
40  List<String> cmds = new ArrayList<>();
41  commands.forEach((mc) -> {
42  cmds.add(mc.getHelpCommand());
43  });
44  return cmds;
45  }

◆ itsMe()

boolean org.turro.action.content.AbstractContentProvider.itsMe ( String  command)

Implements org.turro.action.content.IContentProvider.

Definition at line 48 of file AbstractContentProvider.java.

48  {
49  return commands.stream().anyMatch((mc) -> (mc.itsMe(command)));
50  }

◆ loadCommand() [1/2]

◆ loadCommand() [2/2]

ContentRenderer org.turro.action.content.AbstractContentProvider.loadCommand ( String  command,
IContact  contact,
String  idContext 
)

Implements org.turro.action.content.IContentProvider.

Definition at line 53 of file AbstractContentProvider.java.

53  {
54  for(MacroCommand mc : commands) {
55  if(mc.itsMe(command)) {
56  try {
57  mc.parseStringCommand(command);
58  } catch (ParserException ex) {
59  Logger.getLogger(AbstractContentProvider.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
60  }
61  return loadCommand(mc, contact, idContext);
62  }
63  }
64  return null;
65  }
ContentRenderer loadCommand(String command, IContact contact, String idContext)
Here is the call graph for this function:

Member Data Documentation

◆ commands

final List<MacroCommand> org.turro.action.content.AbstractContentProvider.commands = new ArrayList<>()
protected

Definition at line 36 of file AbstractContentProvider.java.


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