public boolean isSingleton() {
return true;
}
public Object createTool() throws Exception {
StaticFunctionDelegatorBuilder builder = new StaticFunctionDelegatorBuilder();
builder.setClassLoader(classLoader);
// add classes
if (mixinClasses != null) {
for (Class<?> mixinClass : mixinClasses) {
builder.addClass(mixinClass);
}
}
// add methods
if (mixinMethods != null) {
for (MethodInfo methodInfo : mixinMethods) {
for (Method method : methodInfo.containingClass.getMethods()) {
String methodName = method.getName();
if (methodName.equals(methodInfo.methodName)) {
builder.addMethod(method, methodInfo.rename);
}
}
}
}
return builder.toObject();
}