buf.append(text.substring(lastIndex, startIndex));
String key = text.substring(startIndex+2, endIndex);
lastIndex = endIndex+1;
- Object replaceText = map.get(key);
+ Object replaceText = (map==null?null:map.get(key));
//System.out.println("key: " + key + " -> " + replaceText);
if (replaceText == null) replaceText = "NOT_FOUND";
buf.append(replaceText.toString());
}
public static String applyProperties(String text) {
- return applyProperties(text, context.getProperties());
+ return applyProperties(text, (context==null?null:context.getProperties()));
}
protected String loadText(String filename) {