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
ConstructorDescriptionConfigResolverImpl
(String commentPrefix, ValueWriter valueWriter, ValueReader valueReader, CustomOptions options, LoadSettings loadSettings, KeyResolver keyResolver, boolean reverseFields) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
Loads the specifiedannotatedConfig
from the specifiedFile
file
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
load
(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedFile
file
using theLoadSettings
loadSettings
specified.void
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
load
(Object annotatedConfig, Reader reader, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedReader
reader
using theLoadSettings
loadSettings
specified.void
Loads the specifiedannotatedConfig
from the specifiedMap
values
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
void
Loads the specifiedannotatedConfig
from the specifiedMap
values
using theLoadSettings
loadSettings
specified.void
loadOrDump
(Object annotatedConfig, File file) Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
loadOrDump
(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using theLoadSettings
loadSettings
specified.options()
Returns theCustomOptions
instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ConfigResolver
Returns theCustomOptions
instance.- Specified by:
options
in interfaceConfigResolver
- Returns:
- options
- See Also:
-
dump
Description copied from interface:ConfigResolver
Dumps the specifiedannotatedConfig
to the specifiedFile
file
. 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:
dump
in 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:
dump
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to dumpwriter
- the writer to dump the annotated config to
-
load
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedFile
file
using the defaultLoadSettings
from 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:
load
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to load tofile
- the file you want to load
-
load
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedFile
file
using theLoadSettings
loadSettings
specified.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:
load
in 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:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedMap
values
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
- Specified by:
load
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to load tovalues
- the values you want to load
-
load
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedMap
values
using theLoadSettings
loadSettings
specified.- Specified by:
load
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated you config you want to load tovalues
- the values you want to loadloadSettings
- the load settings
-
load
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.If you have a
File
instance 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:
load
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to load toreader
- the reader you want to load
-
load
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using theLoadSettings
loadSettings
specified.If you have a
File
instance 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:
load
in 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:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.- Specified by:
loadOrDump
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to load/dumpfile
- the file you want to load/dump to
-
loadOrDump
Description copied from interface:ConfigResolver
Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using theLoadSettings
loadSettings
specified.- Specified by:
loadOrDump
in interfaceConfigResolver
- Parameters:
annotatedConfig
- the annotated config you want to load/dumpfile
- the file you want to load/dump toloadSettings
- the load settings
-