Annotation Interface ConfigFile


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface ConfigFile
Marks a class as a configuration file. The class will be automatically loaded from and saved to the specified file.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Path to the configuration file relative to plugin's data folder.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to create the file if it doesn't exist.
    Template file to use when creating new config.
  • Element Details

    • value

      String value
      Path to the configuration file relative to plugin's data folder. If the path ends with a supported extension (yml/yaml/json/jsonc/toml), MagicUtils can switch formats via <name>.format or magicutils.format.
      Returns:
      the file path
    • autoCreate

      boolean autoCreate
      Whether to create the file if it doesn't exist.
      Returns:
      true to auto-create, false otherwise
      Default:
      true
    • template

      String template
      Template file to use when creating new config.
      Returns:
      path to template file in resources
      Default:
      ""