Package cc.carm.lib.configuration.yaml
Class YAMLConfigProvider
- java.lang.Object
-
- cc.carm.lib.configuration.core.source.ConfigurationProvider<W>
-
- cc.carm.lib.configuration.core.source.impl.FileConfigProvider<YAMLSectionWrapper>
-
- cc.carm.lib.configuration.yaml.YAMLConfigProvider
-
- All Implemented Interfaces:
CommentedYAML
public class YAMLConfigProvider extends FileConfigProvider<YAMLSectionWrapper> implements CommentedYAML
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull ConfigurationCommentscommentsprotected org.bspfsystems.yamlconfiguration.file.YamlConfigurationconfigurationprotected ConfigInitializer<YAMLConfigProvider>initializer-
Fields inherited from class cc.carm.lib.configuration.core.source.impl.FileConfigProvider
file
-
Fields inherited from class cc.carm.lib.configuration.core.source.ConfigurationProvider
updateTime
-
-
Constructor Summary
Constructors Constructor Description YAMLConfigProvider(@NotNull java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ConfigurationCommentsgetComments()@NotNull YAMLSectionWrappergetConfiguration()得到配置文件的原生功能类。@Nullable java.util.List<java.lang.String>getHeaderComments(@Nullable java.lang.String key)@NotNull ConfigInitializer<YAMLConfigProvider>getInitializer()java.util.Set<java.lang.String>getKeys(@Nullable java.lang.String sectionKey, boolean deep)@Nullable java.lang.ObjectgetValue(@NotNull java.lang.String key)voidinitializeConfig()protected voidonReload()针对于不同配置文件类型所执行的重载操作。voidsave()将当前对配置文件的更改进行保存。java.lang.StringserializeValue(@NotNull java.lang.String key, @NotNull java.lang.Object value)-
Methods inherited from class cc.carm.lib.configuration.core.source.impl.FileConfigProvider
getFile, getResource, initializeFile, saveResource
-
Methods inherited from class cc.carm.lib.configuration.core.source.ConfigurationProvider
getHeaderComment, getInlineComment, getUpdateTime, initialize, initialize, initialize, initialize, initialize, isExpired, reload, setHeaderComment, setInlineComment
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cc.carm.lib.yamlcommentupdater.CommentedYAML
getInlineComment, getKeys
-
-
-
-
Field Detail
-
comments
@NotNull protected final @NotNull ConfigurationComments comments
-
configuration
protected org.bspfsystems.yamlconfiguration.file.YamlConfiguration configuration
-
initializer
protected ConfigInitializer<YAMLConfigProvider> initializer
-
-
Method Detail
-
initializeConfig
public void initializeConfig()
-
getConfiguration
@NotNull public @NotNull YAMLSectionWrapper getConfiguration()
Description copied from class:ConfigurationProvider得到配置文件的原生功能类。- Specified by:
getConfigurationin classConfigurationProvider<YAMLSectionWrapper>- Returns:
- 原生类
-
onReload
protected void onReload() throws java.lang.ExceptionDescription copied from class:ConfigurationProvider针对于不同配置文件类型所执行的重载操作。- Specified by:
onReloadin classConfigurationProvider<YAMLSectionWrapper>- Throws:
java.lang.Exception- 当操作出现错误时抛出。
-
getComments
@NotNull public @NotNull ConfigurationComments getComments()
- Specified by:
getCommentsin classConfigurationProvider<YAMLSectionWrapper>
-
save
public void save() throws java.lang.ExceptionDescription copied from class:ConfigurationProvider将当前对配置文件的更改进行保存。- Specified by:
savein classConfigurationProvider<YAMLSectionWrapper>- Throws:
java.lang.Exception- 当保存出现错误时抛出
-
getInitializer
@NotNull public @NotNull ConfigInitializer<YAMLConfigProvider> getInitializer()
- Specified by:
getInitializerin classConfigurationProvider<YAMLSectionWrapper>
-
serializeValue
public java.lang.String serializeValue(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.Object value)- Specified by:
serializeValuein interfaceCommentedYAML
-
getKeys
public java.util.Set<java.lang.String> getKeys(@Nullable @Nullable java.lang.String sectionKey, boolean deep)- Specified by:
getKeysin interfaceCommentedYAML
-
getValue
@Nullable public @Nullable java.lang.Object getValue(@NotNull @NotNull java.lang.String key)- Specified by:
getValuein interfaceCommentedYAML
-
getHeaderComments
@Nullable public @Nullable java.util.List<java.lang.String> getHeaderComments(@Nullable @Nullable java.lang.String key)- Specified by:
getHeaderCommentsin interfaceCommentedYAML
-
-