- All Implemented Interfaces:
Task
public class InvokeTask
extends Object
implements Task
反射执行任务
通过传入类名#方法名,通过反射执行相应的方法
如果是静态方法直接执行,如果是对象方法,需要类有默认的构造方法
- Since:
- Java 17+
- Version:
- 6.5.0
- Author:
- Kimi Liu
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
InvokeTask
public InvokeTask(String classNameWithMethodName)
构造
- Parameters:
classNameWithMethodName - 类名与方法名的字符串表示,方法名和类名使用#隔开或者.隔开
-
Method Details
-
execute
public void execute()
Description copied from interface: Task
执行作业
- Specified by:
execute in interface Task