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

Public Member Functions

 AbstractParser ()
 
ParserMacroSet getParserMacros ()
 
boolean execute (IConstructor constructor, PrintWriter out, String[] tokens)
 
abstract String getParserName ()
 

Protected Member Functions

abstract boolean doExecute ()
 
abstract void explainMacros (ParserMacroSet macros)
 
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)
 

Protected Attributes

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 35 of file AbstractParser.java.

Constructor & Destructor Documentation

◆ AbstractParser()

org.turro.parser.AbstractParser.AbstractParser ( )

Definition at line 44 of file AbstractParser.java.

44  {
45  initParser();
46  }

Member Function Documentation

◆ doExecute()

◆ execute()

boolean org.turro.parser.AbstractParser.execute ( IConstructor  constructor,
PrintWriter  out,
String[]  tokens 
)

Implements org.turro.parser.IParser.

Definition at line 53 of file AbstractParser.java.

53  {
54  this.constructor = constructor;
55  this.out = out;
56  this.tokens = tokens;
57  // escaped double dots
58  for(int i = 1; i < tokens.length; i++) {
59  tokens[i] = tokens[i].replaceAll("/:", ":");
60  }
61  if(tokens.length > 0) {
62  return doExecute();
63  }
64  return false;
65  }
abstract boolean doExecute()
Here is the call graph for this function:

◆ explainMacros()

◆ getDefaultFor()

String org.turro.parser.AbstractParser.getDefaultFor ( int  index)
protected

Definition at line 111 of file AbstractParser.java.

111  {
112  ParserParameter pp = getParameter(index);
113  return pp != null ? pp.getDefaultValue() : null;
114  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMacroName()

String org.turro.parser.AbstractParser.getMacroName ( )
protected

Definition at line 71 of file AbstractParser.java.

71  {
72  return getToken(0);
73  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParserMacros()

ParserMacroSet org.turro.parser.AbstractParser.getParserMacros ( )

Definition at line 48 of file AbstractParser.java.

48  {
49  return parserMacros;
50  }

◆ getParserName()

◆ getToken() [1/6]

String org.turro.parser.AbstractParser.getToken ( int  index)
protected

Definition at line 89 of file AbstractParser.java.

89  {
90  return getToken(index, true);
91  }
Here is the call graph for this function:

◆ getToken() [2/6]

String org.turro.parser.AbstractParser.getToken ( int  index,
boolean  defParameter 
)
protected

Definition at line 93 of file AbstractParser.java.

93  {
94  if(tokens.length > index) {
95  return tokens[index];
96  }
97  return defParameter ? getDefaultFor(index) : null;
98  }
Here is the call graph for this function:

◆ getToken() [3/6]

String org.turro.parser.AbstractParser.getToken ( int  index,
String  def 
)
protected

Definition at line 100 of file AbstractParser.java.

100  {
101  if(tokens.length > index) {
102  return tokens[index];
103  }
104  return def;
105  }

◆ getToken() [4/6]

String org.turro.parser.AbstractParser.getToken ( String  name)
protected

Definition at line 75 of file AbstractParser.java.

75  {
76  return getToken(name, true);
77  }
Here is the caller graph for this function:

◆ getToken() [5/6]

String org.turro.parser.AbstractParser.getToken ( String  name,
boolean  defParameter 
)
protected

Definition at line 79 of file AbstractParser.java.

79  {
80  ParserParameter pp = getParameter(name);
81  return pp != null ? tokens[pp.getOrder()] : pp.getDefaultValue();
82  }
Here is the call graph for this function:

◆ getToken() [6/6]

String org.turro.parser.AbstractParser.getToken ( String  name,
String  def 
)
protected

Definition at line 84 of file AbstractParser.java.

84  {
85  ParserParameter pp = getParameter(name);
86  return pp != null ? tokens[pp.getOrder()] : def;
87  }
Here is the call graph for this function:

◆ getTokenSize()

int org.turro.parser.AbstractParser.getTokenSize ( )
protected

Definition at line 107 of file AbstractParser.java.

107  {
108  return tokens.length;
109  }
Here is the caller graph for this function:

◆ prepareProperties()

void org.turro.parser.AbstractParser.prepareProperties ( ElephantMarker  marker,
String  properties 
)
protected

Definition at line 116 of file AbstractParser.java.

116  {
117  try {
118  File file = Files.file(marker.getConstructor(), properties + ".properties");
119  if(file.exists()) {
120  marker.put("props", FileUtil.getOrderedProperties(file));
121  }
122  } catch (IOException ex) {
123  Logger.getLogger(DocumentationParser.class.getName()).log(Level.SEVERE, null, ex);
124  }
125  }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ constructor

IConstructor org.turro.parser.AbstractParser.constructor
protected

Definition at line 37 of file AbstractParser.java.

◆ out

PrintWriter org.turro.parser.AbstractParser.out
protected

Definition at line 39 of file AbstractParser.java.

◆ parserMacros

ParserMacroSet org.turro.parser.AbstractParser.parserMacros = new ParserMacroSet()
protected

Definition at line 41 of file AbstractParser.java.

◆ parserName

String org.turro.parser.AbstractParser.parserName
protected

Definition at line 40 of file AbstractParser.java.

◆ tokens

String [] org.turro.parser.AbstractParser.tokens
protected

Definition at line 38 of file AbstractParser.java.


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