FineReport V10.0插件开发配置工程。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

package com.fr.learn;
5 years ago
import com.fr.log.FineLoggerFactory;
5 years ago
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Leaner {
static {
// 这段代码让插件能支持远程设计的时候的调试
String workDir = System.getProperty("user.dir");
System.setProperty("fine.plugin.home", workDir + "/webroot/WEB-INF/plugins");
}
5 years ago
public static void main(String[] args) {
try {
Class mainClass = Class.forName("com.fr.start.MainDesigner");
invokeMain(mainClass, args);
} catch (ClassNotFoundException e) {
// MainDesigner找不到,走以前的Designer
try {
Class oldMainClass = Class.forName("com.fr.start.Designer");
invokeMain(oldMainClass, args);
} catch (ClassNotFoundException ex) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
private static void invokeMain(Class clazz, String[] args) {
try {
Method method = clazz.getMethod("main", String[].class);
Object[] param = new Object[] {args};
method.invoke(clazz, param);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}