Class BasicFileSettingSpecifier
java.lang.Object
net.solarnetwork.settings.support.BaseSettingSpecifier
net.solarnetwork.settings.support.BaseKeyedSettingSpecifier<org.springframework.core.io.Resource>
net.solarnetwork.node.settings.support.BasicFileSettingSpecifier
- All Implemented Interfaces:
FileSettingSpecifier,net.solarnetwork.settings.KeyedSettingSpecifier<org.springframework.core.io.Resource>,net.solarnetwork.settings.MappableSpecifier,net.solarnetwork.settings.SettingSpecifier
public class BasicFileSettingSpecifier
extends net.solarnetwork.settings.support.BaseKeyedSettingSpecifier<org.springframework.core.io.Resource>
implements FileSettingSpecifier
Basic implementation of
FileSettingSpecifier.- Version:
- 2.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.settings.MappableSpecifier
net.solarnetwork.settings.MappableSpecifier.Mapper -
Constructor Summary
ConstructorsConstructorDescriptionBasicFileSettingSpecifier(String key, org.springframework.core.io.Resource defaultValue) Constructor.BasicFileSettingSpecifier(String key, org.springframework.core.io.Resource defaultValue, Set<String> acceptableFileTypeSpecifiers, boolean multiple) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet a set of file type specifiers this specifier can accept.booleanFlag indicating if multiple files can be accepted by this setting.net.solarnetwork.settings.SettingSpecifiermappedWithMapper(net.solarnetwork.settings.MappableSpecifier.Mapper mapper) net.solarnetwork.settings.SettingSpecifiermappedWithPlaceholer(String template) Methods inherited from class net.solarnetwork.settings.support.BaseKeyedSettingSpecifier
getDefaultValue, getDescriptionArguments, getKey, isTransient, mappedTo, setDefaultValue, setDescriptionArguments, setKey, setTransient, toStringMethods inherited from class net.solarnetwork.settings.support.BaseSettingSpecifier
getTitle, getType, setTitleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.settings.KeyedSettingSpecifier
getDefaultValue, getDescriptionArguments, getKey, isTransientMethods inherited from interface net.solarnetwork.settings.MappableSpecifier
mappedToMethods inherited from interface net.solarnetwork.settings.SettingSpecifier
getTitle, getType
-
Constructor Details
-
BasicFileSettingSpecifier
Constructor.This sets
acceptableFileTypeSpecifiersto null andmultipleto false.- Parameters:
key- the keydefaultValue- the default value
-
BasicFileSettingSpecifier
public BasicFileSettingSpecifier(String key, org.springframework.core.io.Resource defaultValue, Set<String> acceptableFileTypeSpecifiers, boolean multiple) Constructor.- Parameters:
key- the keydefaultValue- the default valueacceptableFileTypeSpecifiers- the acceptable file type specifiers, or null if all files are acceptablemultiple- true if multiple files can be accepted, false if only a single file is acceptable
-
-
Method Details
-
mappedWithPlaceholer
- Specified by:
mappedWithPlaceholerin interfacenet.solarnetwork.settings.MappableSpecifier
-
mappedWithMapper
public net.solarnetwork.settings.SettingSpecifier mappedWithMapper(net.solarnetwork.settings.MappableSpecifier.Mapper mapper) - Specified by:
mappedWithMapperin interfacenet.solarnetwork.settings.MappableSpecifier
-
getAcceptableFileTypeSpecifiers
Description copied from interface:FileSettingSpecifierGet a set of file type specifiers this specifier can accept.A file type specifier can be either a file name extension, starting with a period character, or a MIME type, including those with a wildcard subtype. For example .jpg, image/jpg, and image/* are valid values.
If the returned value is null or empty, then all file types are acceptable.
- Specified by:
getAcceptableFileTypeSpecifiersin interfaceFileSettingSpecifier- Returns:
- the set of acceptable types
-
isMultiple
public boolean isMultiple()Description copied from interface:FileSettingSpecifierFlag indicating if multiple files can be accepted by this setting.- Specified by:
isMultiplein interfaceFileSettingSpecifier- Returns:
- true if multiple files are acceptable
-