protected String isSymbolAssignment(String expected) { return SlimSymbol.isSymbolAssignment(expected); }
protected String formatSymbol(String symbolName) { String value = getSymbolValue(symbolName); if (value == null) { // return the original match without any change if the symbol is not defined return symbolMatcher.group(); } else return formatSymbolValue(symbolName, value); }
public String replace(String s) { if(null == s) return null; // Don't replace assignments, return as is if (isSymbolAssignment(s) != null) return s; replacedString = s; symbolMatcher = SYMBOL_PATTERN.matcher(s); replaceAllSymbols(); return replacedString; }
private void replaceAllSymbols() { startingPosition = 0; while (symbolFound()) replaceSymbol(); }
private void replaceSymbol() { String value; String prefix; String suffix; String symbolName = symbolMatcher.group(1); value = formatSymbol(symbolName); prefix = replacedString.substring(0, symbolMatcher.start()); suffix = replacedString.substring(symbolMatcher.end()); replacedString = prefix + value + suffix; int replacementEnd = symbolMatcher.start() + value.length(); startingPosition = Math.min(replacementEnd, replacedString.length()); }
private void replaceAllSymbols() { startingPosition = 0; while (symbolFound()) replaceSymbol(); }
private void replaceSymbol() { String value; String prefix; String suffix; String symbolName = symbolMatcher.group(1); value = formatSymbol(symbolName); prefix = replacedString.substring(0, symbolMatcher.start()); suffix = replacedString.substring(symbolMatcher.end()); replacedString = prefix + value + suffix; int replacementEnd = symbolMatcher.start() + value.length(); startingPosition = Math.min(replacementEnd, replacedString.length()); }
protected String isSymbolAssignment(String expected) { return SlimSymbol.isSymbolAssignment(expected); }
public String replace(String s) { if(null == s) return null; // Don't replace assignments, return as is if (isSymbolAssignment(s) != null) return s; replacedString = s; symbolMatcher = SYMBOL_PATTERN.matcher(s); replaceAllSymbols(); return replacedString; }
protected String formatSymbol(String symbolName) { String value = getSymbolValue(symbolName); if (value == null) { // return the original match without any change if the symbol is not defined return symbolMatcher.group(); } else return formatSymbolValue(symbolName, value); }
public String replaceSymbolsInString(String arg) { // Symbol assignments are not done by the fixture code so remove them and // return an empty string if (SlimSymbol.isSymbolAssignment(arg) != null) return ""; return new SlimSymbol() { @Override protected String getSymbolValue(String symbolName) { return getStoreSymbolValue(symbolName); } }.replace(arg); }
protected boolean assignSymbolIfApplicable(String text, Object value) { String symbol = SlimSymbol.isSymbolAssignment(text); boolean result = symbol != null; if (result) { context.assign(symbol, value); } return result; } }
protected boolean assignSymbolIfApplicable(String text, Object value) { String symbol = SlimSymbol.isSymbolAssignment(text); boolean result = symbol != null; if (result) { context.assign(symbol, value); } return result; } }
protected boolean assignSymbolIfApplicable(String text, Object value) { String symbol = SlimSymbol.isSymbolAssignment(text); boolean result = symbol != null; if (result) { context.assign(symbol, value); } return result; }
public String replaceSymbolsInString(String arg) { // Symbol assignments are not done by the fixture code so remove them and // return an empty string if (SlimSymbol.isSymbolAssignment(arg) != null) return ""; return new SlimSymbol() { @Override protected String getSymbolValue(String symbolName) { return getStoreSymbolValue(symbolName); } }.replace(arg); }