![JAR search and dependency download from the Maven repository](/logo.png)
nl.hsac.fitnesse.symbols.SymbolBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-plugin Show documentation
Show all versions of hsac-fitnesse-plugin Show documentation
Plugin to add features to a FitNesse installation
The newest version!
package nl.hsac.fitnesse.symbols;
import fitnesse.wikitext.parser.Maybe;
import fitnesse.wikitext.parser.Parser;
import fitnesse.wikitext.parser.Symbol;
import fitnesse.wikitext.parser.SymbolType;
import java.util.List;
public class SymbolBase extends SymbolType {
protected SymbolBase(String name) {
super(name);
}
protected Maybe storeParenthesisContent(Symbol current, Parser parser, String key) {
Maybe result = new Maybe(current);
List lookAhead = parser.peek(new SymbolType[] { SymbolType.Whitespace, SymbolType.OpenParenthesis });
if (lookAhead.size() != 0) {
parser.moveNext(2);
Maybe format = parser.parseToAsString(SymbolType.CloseParenthesis);
if (format.isNothing()) {
result = Symbol.nothing;
}
current.putProperty(key, format.getValue());
}
return result;
}
protected int getProperty(Symbol symbol, String key, int defaultValue) {
int result = defaultValue;
String property = symbol.findProperty(key, null);
if (property != null) {
result = parseInt(property);
}
return result;
}
protected int parseInt(String strValue) {
return Integer.parseInt(strValue.trim());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy