Package com.ultikits.ultitools.utils
Class ConfigEditorUtils
java.lang.Object
com.ultikits.ultitools.utils.ConfigEditorUtils
Utility class for configuration editor operations.
Provides methods to get and update configuration data in JSON format.
This class is used internally by the configuration editor system.
配置编辑器操作的实用工具类。 提供以JSON格式获取和更新配置数据的方法。 此类由配置编辑器系统内部使用。
配置编辑器操作的实用工具类。 提供以JSON格式获取和更新配置数据的方法。 此类由配置编辑器系统内部使用。
- Since:
- 6.0.0
- Author:
- wisdomme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringGet the comment map as a JSON string.protected static StringGet the configuration map as a JSON string.protected static voidupdateConfigMap(String configMapString) Update the configuration map from a JSON string.protected static voidupdateConfigMap(String fileName, String configMapString) Update a single configuration file from a JSON string.
-
Constructor Details
-
ConfigEditorUtils
public ConfigEditorUtils()
-
-
Method Details
-
getConfigMapString
Get the configuration map as a JSON string.
获取配置映射的JSON字符串。- Returns:
- JSON string representation of the configuration map
配置映射的JSON字符串表示
-
getCommentMapString
Get the comment map as a JSON string.
获取注释映射的JSON字符串。- Returns:
- JSON string representation of the comment map
注释映射的JSON字符串表示
-
updateConfigMap
Update the configuration map from a JSON string.
从JSON字符串更新配置映射。- Parameters:
configMapString- JSON string containing the new configuration
包含新配置的JSON字符串- Throws:
IOException- if an I/O error occurs during update
如果更新过程中发生I/O错误
-
updateConfigMap
Update a single configuration file from a JSON string.
从JSON字符串更新单个配置文件。面板按文件名下发配置时走这条:
configMapString是该文件自己的{配置项: 值},而不是updateConfigMap(String)那种{插件名: {配置路径: {...}}}的全量结构。两种形状对应面板上两个不同的入口, 混用会写不进去且不报错——见 issue #236。- Parameters:
fileName- config file path as registered, e.g.config/lang.yml
注册时使用的配置文件路径configMapString- JSON string containing that file's entries
该文件配置项的JSON字符串- Throws:
IOException- if the file is unknown or ambiguous, or the update fails
如果文件找不到、跨插件重名或更新失败- Since:
- 6.2.5
-