throw new BSFException("The apply method is not yet supported for simple-methods");
}
public Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException {
if (!(expr instanceof String)) throw new BSFException("simple-method expression must be a string");
//right now only supports one method per file, so get all methods and just run the first...
Map<String, SimpleMethod> simpleMethods = null;
try {
simpleMethods = SimpleMethod.getDirectSimpleMethods(source, (String) expr, "<bsf source>");
} catch (MiniLangException e) {
throw new BSFException("Error loading/parsing simple-method XML source: " + e.getMessage());
}
Set<String> smNames = simpleMethods.keySet();
if (smNames.size() == 0) throw new BSFException("Did not find any simple-methods in the file");
String methodName = smNames.iterator().next();
if (smNames.size() > 1) Debug.logWarning("Found more than one simple-method in the file, running the [" + methodName + "] method, you should remove all but one method from this file", module);
SimpleMethod simpleMethod = simpleMethods.get(methodName);