Package space.arim.dazzleconf.factory
Class BaseConfigurationFactory<C>
java.lang.Object
space.arim.dazzleconf.factory.BaseConfigurationFactory<C>
- Type Parameters:
C- the type of the configuration
- All Implemented Interfaces:
ConfigurationFactory<C>
@Deprecated
public abstract class BaseConfigurationFactory<C>
extends Object
implements ConfigurationFactory<C>
Deprecated.
Will be removed without replacement in a later release. Contributes
little value on its own.
Basic abstract implementation of of
ConfigurationFactory. Eliminates some basic boilerplate
associated with IO operations.- Author:
- A248
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseConfigurationFactory(Class<C> configClass, ConfigurationOptions options) Deprecated.Creates from a config class and config options -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Charsetcharset()Deprecated.The charset used by this factoryDeprecated.Gets the configuration class this factory is forDeprecated.Gets the configuration options this factory usesload(InputStream inputStream) Deprecated.Reads configuration data from an input streamload(InputStream inputStream, C auxiliaryEntries) Deprecated.Reads configuration data from an input stream with the given auxiliary configuration instance.load(ReadableByteChannel readChannel) Deprecated.Reads configuration data from a readable channelload(ReadableByteChannel readChannel, C auxiliaryEntries) Deprecated.Reads configuration data from a readable channel with the given auxiliary configuration instance.protected abstract CloadFromReader(Reader reader) Deprecated.Reads config data from the specified readerprotected abstract CloadFromReader(Reader reader, C auxiliaryEntries) Deprecated.Reads config data from the specified reader with the given auxiliary entries.voidwrite(C configData, OutputStream outputStream) Deprecated.Writes configuration data to an output streamvoidwrite(C configData, WritableByteChannel writableChannel) Deprecated.Writes configuration data to a writable byte channelprotected abstract voidwriteToWriter(C configData, Writer writer) Deprecated.Writes config data to the specified writerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface space.arim.dazzleconf.ConfigurationFactory
loadDefaults
-
Constructor Details
-
BaseConfigurationFactory
Deprecated.Creates from a config class and config options- Parameters:
configClass- the config classoptions- configuration options- Throws:
NullPointerException- ifconfigClassoroptionsis nullIllegalArgumentException- ifconfigClassis not an interface
-
-
Method Details
-
getConfigClass
Deprecated.Description copied from interface:ConfigurationFactoryGets the configuration class this factory is for- Specified by:
getConfigClassin interfaceConfigurationFactory<C>- Returns:
- the configuration class
-
getOptions
Deprecated.Description copied from interface:ConfigurationFactoryGets the configuration options this factory uses- Specified by:
getOptionsin interfaceConfigurationFactory<C>- Returns:
- the configuration options
-
charset
Deprecated.The charset used by this factory- Returns:
- the charset to use
-
loadFromReader
Deprecated.Reads config data from the specified reader- Parameters:
reader- the stream reader- Returns:
- the config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is not valid
-
loadFromReader
protected abstract C loadFromReader(Reader reader, C auxiliaryEntries) throws IOException, InvalidConfigException Deprecated.Reads config data from the specified reader with the given auxiliary entries. The auxiliary entries are the same ones passed toConfigurationFactory- Parameters:
reader- the stream readerauxiliaryEntries- the auxiliary entries- Returns:
- the config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is not valid
-
load
Deprecated.Description copied from interface:ConfigurationFactoryReads configuration data from a readable channel- Specified by:
loadin interfaceConfigurationFactory<C>- Parameters:
readChannel- the channel from which to read the data- Returns:
- the read config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is invalid. Where possible, more specific subclasses are thrown
-
load
Deprecated.Description copied from interface:ConfigurationFactoryReads configuration data from an input stream- Specified by:
loadin interfaceConfigurationFactory<C>- Parameters:
inputStream- the stream from which to read the data- Returns:
- the read config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is invalid. Where possible, more specific subclasses are thrown
-
load
public C load(ReadableByteChannel readChannel, C auxiliaryEntries) throws IOException, InvalidConfigException Deprecated.Description copied from interface:ConfigurationFactoryReads configuration data from a readable channel with the given auxiliary configuration instance. Any keys missing in the loaded config data will be supplanted by the config instance's corresponding entry.
By checking if the returned configuration implementsAuxiliaryKeys, the caller can determine whether any of the auxiliary entries were used.- Specified by:
loadin interfaceConfigurationFactory<C>- Parameters:
readChannel- the channel from which to read the dataauxiliaryEntries- the auxiliary configuration instance- Returns:
- the read config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is invalid. Where possible, more specific subclasses are thrown
-
load
public C load(InputStream inputStream, C auxiliaryEntries) throws IOException, InvalidConfigException Deprecated.Description copied from interface:ConfigurationFactoryReads configuration data from an input stream with the given auxiliary configuration instance. Any keys missing in the loaded config data will be supplanted by the config instance's corresponding entry.
By checking if the returned configuration implementsAuxiliaryKeys, the caller can determine whether any of the auxiliary entries were used.- Specified by:
loadin interfaceConfigurationFactory<C>- Parameters:
inputStream- the stream from which to read the dataauxiliaryEntries- the auxiliary configuration instance- Returns:
- the read config data
- Throws:
IOException- if an I/O error occursInvalidConfigException- if the configuration is invalid. Where possible, more specific subclasses are thrown
-
writeToWriter
Deprecated.Writes config data to the specified writer- Parameters:
configData- the configuration data to writewriter- the stream writer- Throws:
IOException- if an I/O error occurs
-
write
Deprecated.Description copied from interface:ConfigurationFactoryWrites configuration data to a writable byte channel- Specified by:
writein interfaceConfigurationFactory<C>- Parameters:
configData- the configuration datawritableChannel- the channel to which to write the data- Throws:
IOException- if an I/O error occurs
-
write
Deprecated.Description copied from interface:ConfigurationFactoryWrites configuration data to an output stream- Specified by:
writein interfaceConfigurationFactory<C>- Parameters:
configData- the configuration dataoutputStream- the stream to which to write the data- Throws:
IOException- if an I/O error occurs
-