Class SnakeYamlConfigurationFactory<C>
java.lang.Object
space.arim.dazzleconf.factory.AbstractConfigurationFactory<C>
space.arim.dazzleconf.ext.snakeyaml.SnakeYamlConfigurationFactory<C>
- Type Parameters:
C- the configuration type
- All Implemented Interfaces:
ConfigurationFactory<C>
A
Note: Relying on the identity of this class is deprecated, for example relying on this class implementing
ConfigurationFactory implementation using SnakeYAML to load a yaml configuration. Note: Relying on the identity of this class is deprecated, for example relying on this class implementing
ConfigurationFactory. In a future major release, the implementation
of the factory returned from the create methods may be refactored.- Author:
- A248
-
Constructor Summary
ConstructorsConstructorDescriptionSnakeYamlConfigurationFactory(Class<C> configClazz, ConfigurationOptions options) Deprecated.SnakeYamlConfigurationFactory(Class<C> configClazz, ConfigurationOptions options, SnakeYamlOptions yamlOptions) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected Charsetcharset()static <C> ConfigurationFactory<C> create(Class<C> configClass, ConfigurationOptions options) Creates from a configuration class and config options.static <C> ConfigurationFactory<C> create(Class<C> configClass, ConfigurationOptions options, SnakeYamlOptions yamlOptions) Creates from a configuration class, config options, andSnakeYamlOptionsload(InputStream arg0) load(InputStream arg0, C arg1) load(ReadableByteChannel arg0) load(ReadableByteChannel arg0, C arg1) loadMapFromReader(Reader reader) protected booleanvoidwrite(C arg0, OutputStream arg1) voidwrite(C arg0, WritableByteChannel arg1) protected voidwriteMapToWriter(Map<String, Object> rawMap, Writer writer) Methods inherited from class space.arim.dazzleconf.factory.AbstractConfigurationFactory
getHeader, pseudoCommentsSuffix
-
Constructor Details
-
SnakeYamlConfigurationFactory
@Deprecated public SnakeYamlConfigurationFactory(Class<C> configClazz, ConfigurationOptions options, SnakeYamlOptions yamlOptions) Deprecated.Usecreate(Class, ConfigurationOptions, SnakeYamlOptions). Subclassing should not be used; prefer the delegation pattern instead. See the class javadoc for more info.Creates from a configuration class, config options, andSnakeYamlOptions- Parameters:
configClazz- the config classoptions- the config optionsyamlOptions- the snake yaml options- Throws:
IllegalArgumentException- ifconfigClazzis not an interfaceIllDefinedConfigException- if a configuration entry inconfigClazzis not defined properly
-
SnakeYamlConfigurationFactory
@Deprecated public SnakeYamlConfigurationFactory(Class<C> configClazz, ConfigurationOptions options) Deprecated.Usecreate(Class, ConfigurationOptions). Subclassing should not be used; prefer the delegation pattern instead. See the class javadoc for more info.Creates from a configuration class and config options, using the defaultSnakeYamlOptions(including "block" flow style and UTF 8)- Parameters:
configClazz- the config classoptions- the config options- Throws:
IllegalArgumentException- ifconfigClazzis not an interfaceIllDefinedConfigException- if a configuration entry inconfigClazzis not defined properly
-
-
Method Details
-
create
public static <C> ConfigurationFactory<C> create(Class<C> configClass, ConfigurationOptions options, SnakeYamlOptions yamlOptions) Creates from a configuration class, config options, andSnakeYamlOptions- Type Parameters:
C- the configuration type- Parameters:
configClass- the config classoptions- the config optionsyamlOptions- the snake yaml options- Returns:
- the configuration factory
- Throws:
IllegalArgumentException- ifconfigClassis not an interfaceIllDefinedConfigException- if a configuration entry inconfigClassis not defined properly
-
create
public static <C> ConfigurationFactory<C> create(Class<C> configClass, ConfigurationOptions options) Creates from a configuration class and config options.
Uses the default yaml options, which include "block" flow style and UTF 8 encoding- Type Parameters:
C- the configuration type- Parameters:
configClass- the config classoptions- the config options- Returns:
- the configuration factory
- Throws:
IllegalArgumentException- ifconfigClassis not an interfaceIllDefinedConfigException- if a configuration entry inconfigClassis not defined properly
-
supportsCommentsThroughWrapper
protected boolean supportsCommentsThroughWrapper()- Overrides:
supportsCommentsThroughWrapperin classAbstractConfigurationFactory<C>
-
charset
- Specified by:
charsetin classAbstractConfigurationFactory<C>
-
loadMapFromReader
protected Map<String,Object> loadMapFromReader(Reader reader) throws IOException, ConfigFormatSyntaxException - Specified by:
loadMapFromReaderin classAbstractConfigurationFactory<C>- Throws:
IOExceptionConfigFormatSyntaxException
-
writeMapToWriter
- Specified by:
writeMapToWriterin classAbstractConfigurationFactory<C>- Throws:
IOException
-
getConfigClass
- Specified by:
getConfigClassin interfaceConfigurationFactory<C>
-
getOptions
- Specified by:
getOptionsin interfaceConfigurationFactory<C>
-
load
- Specified by:
loadin interfaceConfigurationFactory<C>- Throws:
IOExceptionInvalidConfigException
-
load
- Specified by:
loadin interfaceConfigurationFactory<C>- Throws:
IOExceptionInvalidConfigException
-
load
- Specified by:
loadin interfaceConfigurationFactory<C>- Throws:
IOExceptionInvalidConfigException
-
load
- Specified by:
loadin interfaceConfigurationFactory<C>- Throws:
IOExceptionInvalidConfigException
-
loadDefaults
- Specified by:
loadDefaultsin interfaceConfigurationFactory<C>
-
write
- Specified by:
writein interfaceConfigurationFactory<C>- Throws:
IOException
-
write
- Specified by:
writein interfaceConfigurationFactory<C>- Throws:
IOException
-
create(Class, ConfigurationOptions).