BrightSide Workbench Full Report + Source Code
org.turro.parser.wiki.ElephantProcessor Class Reference
Inheritance diagram for org.turro.parser.wiki.ElephantProcessor:
Collaboration diagram for org.turro.parser.wiki.ElephantProcessor:

Public Member Functions

String expand (IConstructor constructor, IContact contact, String name, Map< String, String > pars)
 
String help (IConstructor constructor, String name)
 
Set< String > locateNames (IConstructor constructor)
 

Detailed Description

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

Definition at line 39 of file ElephantProcessor.java.

Member Function Documentation

◆ expand()

String org.turro.parser.wiki.ElephantProcessor.expand ( IConstructor  constructor,
IContact  contact,
String  name,
Map< String, String >  pars 
)

Implements org.turro.parser.wiki.IMacroProcessor.

Definition at line 42 of file ElephantProcessor.java.

42  {
43  if(contact == null) contact = constructor.getUser();
44  String template = locateTemplate(constructor, name);
45  if(!Strings.isBlank(template)) {
46  ElephantMarker marker = new ElephantMarker(constructor);
47  marker.put("help", false);
48  marker.put("end", name.startsWith("/"));
49  marker.putAll(pars);
50  marker.put("contact", checkContact(contact, pars));
51  return marker.parse(TMPL_ROOT, template);
52  }
53  return null;
54  }
Here is the call graph for this function:

◆ help()

String org.turro.parser.wiki.ElephantProcessor.help ( IConstructor  constructor,
String  name 
)

Implements org.turro.parser.wiki.IMacroProcessor.

Definition at line 57 of file ElephantProcessor.java.

57  {
58  String template = locateTemplate(constructor, name);
59  if(!Strings.isBlank(template)) {
60  ElephantMarker marker = new ElephantMarker(constructor);
61  marker.put("help", true);
62  marker.put("end", false);
63  return marker.parse(TMPL_ROOT, template);
64  }
65  return null;
66  }
Here is the call graph for this function:

◆ locateNames()

Set<String> org.turro.parser.wiki.ElephantProcessor.locateNames ( IConstructor  constructor)

Implements org.turro.parser.wiki.IMacroProcessor.

Definition at line 73 of file ElephantProcessor.java.

73  {
74  Folder root = Folder.from(ElephantMarker.templateRoot(constructor, false) + "/" + TMPL_ROOT);
75  Set<String> names = new TreeSet<>();
76  if(root.exists()) {
77  try {
78  root.documents("*Template.html").forEach(d -> {
79  names.add(d.name().replace("Template.html", ""));
80  });
81  } catch (IOException ex) {
82  Logger.getLogger(ElephantProcessor.class.getName()).log(Level.SEVERE, null, ex);
83  }
84  }
85  return names;
86  }
Here is the call graph for this function:

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