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

Public Member Functions

String getParserName ()
 
- Public Member Functions inherited from org.turro.parser.AbstractParser
 AbstractParser ()
 
ParserMacroSet getParserMacros ()
 
boolean execute (IConstructor constructor, PrintWriter out, String[] tokens)
 

Protected Member Functions

boolean doExecute ()
 
void explainMacros (ParserMacroSet macros)
 
- Protected Member Functions inherited from org.turro.parser.AbstractParser
String getMacroName ()
 
String getToken (String name)
 
String getToken (String name, boolean defParameter)
 
String getToken (String name, String def)
 
String getToken (int index)
 
String getToken (int index, boolean defParameter)
 
String getToken (int index, String def)
 
int getTokenSize ()
 
String getDefaultFor (int index)
 
void prepareProperties (ElephantMarker marker, String properties)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.parser.AbstractParser
IConstructor constructor
 
String[] tokens
 
PrintWriter out
 
String parserName
 
ParserMacroSet parserMacros = new ParserMacroSet()
 

Detailed Description

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

Definition at line 40 of file DocumentationParser.java.

Member Function Documentation

◆ doExecute()

boolean org.turro.parser.DocumentationParser.doExecute ( )
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 48 of file DocumentationParser.java.

48  {
49  boolean done = false;
50  if("provider-macros".equals(getMacroName())) {
51  ElephantMarker marker = new ElephantMarker(constructor);
52  marker.put("providers", ContentProviders.getProviders());
53  prepareProperties(marker, getToken(1));
54  marker.process(getToken(2), getToken(3));
55  } else if("social-groups".equals(getMacroName())) {
56  ElephantMarker marker = new ElephantMarker(constructor);
57  marker.put("socialGroups", SecurityGroups.getAll().stream().sorted().toList());
58  marker.put("roles", Permissions.permissionStringMap());
59  prepareProperties(marker, getToken(1));
60  marker.process(getToken(2), getToken(3));
61  } else if("elephant-macros".equals(getMacroName())) {
62  ElephantMarker marker = new ElephantMarker(constructor);
63  marker.put("elephantParsers",
64  Instances.cached().byAnnotation(ExternalParser.class, IParser.class)
65  .stream().filter((p) -> {
66  return "all".equals(getToken(1)) ||
67  ((p instanceof AbstractParser) &&
68  ((AbstractParser) p).getParserName().equals(getToken(1)));
69  }).collect(Collectors.toList()));
70  marker.put("headers", "true".equals(getToken(2)));
71  prepareProperties(marker, getToken(3));
72  marker.process(getToken(4), getToken(5));
73  } else if("elephant-emojis".equals(getMacroName())) {
74  ElephantMarker marker = new ElephantMarker(constructor);
75  marker.put("emojimap", EmojiMap.getInstance());
76  marker.process(getToken(1), getToken(2));
77  } else if("elephant-icons".equals(getMacroName())) {
78  ElephantMarker marker = new ElephantMarker(constructor);
79  marker.put("iconset", IconSet.getInstance());
80  marker.process(getToken(1), getToken(2));
81  } else if("elephant-indicators".equals(getMacroName())) {
82  ElephantMarker marker = new ElephantMarker(constructor);
83  marker.put("elephantIndicators", Indicators.getIndicators().stream().filter((i) -> {
84  return "all".equals(getToken(1)) ||
85  ((i instanceof IElephantIndicator) &&
86  ((IElephantIndicator) i).getRoot().equals(getToken(1)));
87  }).collect(Collectors.toList()));
88  marker.put("headers", "true".equals(getToken(2)));
89  prepareProperties(marker, getToken(3));
90  marker.process(getToken(4), getToken(5));
91  } else if("notice".equals(getMacroName())) {
92  ElephantMarker marker = new ElephantMarker(constructor);
93  marker.put("notice", Secrets.<List<String>>getObject("key=notice;show=false"));
94  marker.process("widgets/licenses", "notice");
95  } else if("licenses".equals(getMacroName())) {
96  ElephantMarker marker = new ElephantMarker(constructor);
97  marker.put("licenses", Secrets.<List<String>>getObject("key=licenses;show=false"));
98  marker.process("widgets/licenses", "licenses");
99  } else if("libraries".equals(getMacroName())) {
100  ElephantMarker marker = new ElephantMarker(constructor);
101  marker.put("libraries", Secrets.<List<String>>getObject("key=libraries;show=false"));
102  marker.process("widgets/licenses", "libraries");
103  }
104  return done;
105  }
void prepareProperties(ElephantMarker marker, String properties)
Here is the call graph for this function:

◆ explainMacros()

void org.turro.parser.DocumentationParser.explainMacros ( ParserMacroSet  macros)
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 108 of file DocumentationParser.java.

108  {
109  macros.addMacro("provider-macros")
110  .addParameter("doc-properties", true, "*/documentation")
111  .addParameter("tmpl-root", true, "documentation")
112  .addParameter("template", true, "providerMacros");
113  macros.addMacro("social-groups")
114  .addParameter("doc-properties", true, "*/documentation")
115  .addParameter("tmpl-root", true, "documentation")
116  .addParameter("template", true, "socialGroups");
117  macros.addMacro("elephant-macros")
118  .addParameter("parser", false, "all")
119  .addParameter("headers", true, "true")
120  .addParameter("doc-properties", true, "*/documentation")
121  .addParameter("tmpl-root", true, "documentation")
122  .addParameter("template", true, "elephantMacros");
123  macros.addMacro("elephant-emojis")
124  .addParameter("tmpl-root", true, "documentation")
125  .addParameter("template", true, "providerEmojis");
126  macros.addMacro("elephant-icons")
127  .addParameter("tmpl-root", true, "documentation")
128  .addParameter("template", true, "providerIcons");
129  macros.addMacro("elephant-indicators")
130  .addParameter("indicator", false, "all")
131  .addParameter("headers", true, "true")
132  .addParameter("doc-properties", true, "*/documentation")
133  .addParameter("tmpl-root", true, "documentation")
134  .addParameter("template", true, "elephantIndicators");
135  }
Here is the call graph for this function:

◆ getParserName()

String org.turro.parser.DocumentationParser.getParserName ( )

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 43 of file DocumentationParser.java.

43  {
44  return "Documentation";
45  }

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