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

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 38 of file WebParser.java.

Member Function Documentation

◆ doExecute()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 46 of file WebParser.java.

46  {
47  boolean done = false;
48  if("wtargets".equals(getMacroName())) {
49  FunnelVertices fv = FunnelVertices.load(constructor);
50  fv.bySelection("true".equals(getToken(2)));
51  Set<FunnelVertex> vertices = switch(getToken(1)) {
52  case "all" -> fv.targets();
53  case "current" -> CollectionUtil.setOf(fv.currentTarget());
54  default -> Collections.EMPTY_SET;
55  };
56  vertexMarker(vertices, getToken(3));
57  done = true;
58  } else if("wsolutions".equals(getMacroName())) {
59  FunnelVertices fv = FunnelVertices.load(constructor);
60  fv.bySelection("true".equals(getToken(2)));
61  Set<FunnelVertex> vertices = switch(getToken(1)) {
62  case "all" -> fv.solutions();
63  case "current" -> CollectionUtil.setOf(fv.currentSolution());
64  default -> Collections.EMPTY_SET;
65  };
66  vertexMarker(vertices, getToken(3));
67  done = true;
68  } else if("wservices".equals(getMacroName())) {
69  FunnelVertices fv = FunnelVertices.load(constructor);
70  fv.bySelection("true".equals(getToken(2)));
71  Set<FunnelVertex> vertices = switch(getToken(1)) {
72  case "all" -> fv.services();
73  case "current" -> CollectionUtil.setOf(fv.currentService());
74  default -> Collections.EMPTY_SET;
75  };
76  vertexMarker(vertices, getToken(3));
77  done = true;
78  } else if("wnexts".equals(getMacroName())) {
79  FunnelVertices fv = FunnelVertices.load(constructor);
80  Set<FunnelVertex> vertices = fv.nexts();
81  vertexMarker(vertices, getToken(1));
82  done = true;
83  } else if("wsiblings".equals(getMacroName())) {
84  FunnelVertices fv = FunnelVertices.load(constructor);
85  Set<FunnelVertex> vertices = fv.siblings();
86  vertexMarker(vertices, getToken(1));
87  done = true;
88  } else if("wgoals".equals(getMacroName())) {
89  FunnelVertices fv = FunnelVertices.load(constructor);
90  Set<WebGoal> goals = fv.goals();
91  goalMarker(goals, getToken(1));
92  done = true;
93  } else if("witem".equals(getMacroName())) {
94  FunnelVertices fv = FunnelVertices.load(constructor);
95  vertexMarker(CollectionUtil.setOf(fv.getVertex(getToken(1))), getToken(2));
96  done = true;
97  } else if("wgoal".equals(getMacroName())) {
98  FunnelVertices fv = FunnelVertices.load(constructor);
99  goalMarker(CollectionUtil.setOf(fv.getGoal(getToken(1))), getToken(2));
100  done = true;
101  } else if("wexternals".equals(getMacroName())) {
102  FunnelVertices fv = FunnelVertices.load(constructor);
103  linkMarker(fv.externals(), getToken(1));
104  done = true;
105  } else if("funneling-graph".equals(getMacroName())) {
106  FunnelGraphDOT.DOT(out);
107  done = true;
108  }
109  return done;
110  }
Here is the call graph for this function:

◆ explainMacros()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 113 of file WebParser.java.

113  {
114  macros.addMacro("wtargets")
115  .addParameter("mode", false, "all")
116  .addPossibleValue("all")
117  .addPossibleValue("current")
118  .addParameter("selection", true, "true")
119  .addPossibleValue("true")
120  .addPossibleValue("false")
121  .addParameter("template", true, "summary")
122  .addPossibleValue("summary")
123  .addPossibleValue("vlist")
124  .addPossibleValue("hlist");
125  macros.addMacro("wsolutions")
126  .copyParametersFrom("wtargets", macros);
127  macros.addMacro("wservices")
128  .copyParametersFrom("wtargets", macros);
129  macros.addMacro("wnexts")
130  .addParameter("template", true, "summary")
131  .addPossibleValue("summary")
132  .addPossibleValue("vlist")
133  .addPossibleValue("hlist");
134  macros.addMacro("wsiblings")
135  .copyParametersFrom("wnexts", macros);
136  macros.addMacro("wgoals")
137  .addParameter("template", true, "gsummary");
138  macros.addMacro("wcurrent")
139  .addParameter("template", true, "full");
140  macros.addMacro("witem")
141  .addParameter("wtag", false)
142  .addParameter("template", true, "full");
143  macros.addMacro("wgoal")
144  .addParameter("waction", false)
145  .addParameter("template", true, "gfull");
146  macros.addMacro("wexternals")
147  .addParameter("template", true, "webLinks");
148  }
Here is the call graph for this function:

◆ getParserName()

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

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 41 of file WebParser.java.

41  {
42  return "Elephant Web";
43  }

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