Skip to content

Auto Parameter and Configuration Parsing

see Input Arguments of Java Plugin for a brief background.

How does Parameter Auto Parsing work

MCT Plugins are all triggered by a single command line, Parameter is extracted from command line arguments (in java, it's parameters of main() method).

// args is the source of "Parameter"
public static void main(String[] args) {}

You have to provide a class to tell Plugin Manager what type the Parameter is. Given a Parameter Class, Plugin Manager will list all the fields of the class through Java Reflection. Also, Plugin Manager will parse values from command line (the String[] args), then compare and set them to a new Parameter instance.

How does Configuration Auto Parsing work

Plugin Manager supports parsing configuration properties from file, and set them to certain class.

Same as the usage of Parameter, you have to provide a class to tell Plugin Manager what type does the Configuration is. Also, Plugin Manager will read values from configuration file(default location is resources/config.properties), then compare and set them to a new Configuration instance.