Class ConfigResolverImpl
- All Implemented Interfaces:
ConfigResolver
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mrivanplays.annotationconfig.core.resolver.ConfigResolver
ConfigResolver.Builder -
Constructor Summary
ConstructorsConstructorDescriptionConfigResolverImpl(String commentPrefix, ValueWriter valueWriter, ValueReader valueReader, CustomOptions options, LoadSettings loadSettings, KeyResolver keyResolver, boolean reverseFields) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidLoads the specifiedannotatedConfigfrom the specifiedFilefileusing the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().voidload(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfigfrom the specifiedFilefileusing theLoadSettingsloadSettingsspecified.voidLoads the specifiedannotatedConfigfrom the specifiedReaderreaderusing the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().voidload(Object annotatedConfig, Reader reader, LoadSettings loadSettings) Loads the specifiedannotatedConfigfrom the specifiedReaderreaderusing theLoadSettingsloadSettingsspecified.voidloadOrDump(Object annotatedConfig, File file) Loads the specifiedannotatedConfigfrom the specifiedFilefile, if it exists, if not, dumps the specifiedannotatedConfigto the specified file, using the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().voidloadOrDump(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfigfrom the specifiedFilefile, if it exists, if not, dumps the specifiedannotatedConfigto the specified file, using theLoadSettingsloadSettingsspecified.options()Returns theCustomOptionsinstance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mrivanplays.annotationconfig.core.resolver.ConfigResolver
dump, load, load
-
Constructor Details
-
ConfigResolverImpl
public ConfigResolverImpl(String commentPrefix, ValueWriter valueWriter, ValueReader valueReader, CustomOptions options, LoadSettings loadSettings, KeyResolver keyResolver, boolean reverseFields)
-
-
Method Details
-
options
Description copied from interface:ConfigResolverReturns theCustomOptionsinstance.- Specified by:
optionsin interfaceConfigResolver- Returns:
- options
- See Also:
-
dump
Description copied from interface:ConfigResolverDumps the specifiedannotatedConfigto the specifiedFilefile. If, at the time of calling this method, the file exists, it will get deleted ( default implementation ).If you are going to call
ConfigResolver.load(Object, File, LoadSettings)after calling this method, consider usingConfigResolver.loadOrDump(Object, File, LoadSettings)rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Specified by:
dumpin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to dumpfile- the file you want to dump the annotated config to
-
dump
Description copied from interface:ConfigResolver- Specified by:
dumpin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to dumpwriter- the writer to dump the annotated config to
-
load
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedFilefileusing the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().If you have called
ConfigResolver.dump(Object, File)before calling this method, consider usingConfigResolver.loadOrDump(Object, File)rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Specified by:
loadin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load tofile- the file you want to load
-
load
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedFilefileusing theLoadSettingsloadSettingsspecified.If you have called
ConfigResolver.dump(Object, File)before calling this method, consider usingConfigResolver.loadOrDump(Object, File, LoadSettings)rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Specified by:
loadin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load tofile- the file you want to loadloadSettings- the load settings
-
load
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedReaderreaderusing the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().If you have a
Fileinstance before calling that, consider usingConfigResolver.load(Object, File). This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Specified by:
loadin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load toreader- the reader you want to load
-
load
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedReaderreaderusing theLoadSettingsloadSettingsspecified.If you have a
Fileinstance before calling that, consider usingConfigResolver.load(Object, File, LoadSettings). This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Specified by:
loadin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load toreader- the reader you want to loadloadSettings- the load settings
-
loadOrDump
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedFilefile, if it exists, if not, dumps the specifiedannotatedConfigto the specified file, using the defaultLoadSettingsfrom the builder of this config resolver, orLoadSettings.getDefault().- Specified by:
loadOrDumpin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load/dumpfile- the file you want to load/dump to
-
loadOrDump
Description copied from interface:ConfigResolverLoads the specifiedannotatedConfigfrom the specifiedFilefile, if it exists, if not, dumps the specifiedannotatedConfigto the specified file, using theLoadSettingsloadSettingsspecified.- Specified by:
loadOrDumpin interfaceConfigResolver- Parameters:
annotatedConfig- the annotated config you want to load/dumpfile- the file you want to load/dump toloadSettings- the load settings
-