Package loci.formats.in
Class DynamicMetadataOptions
java.lang.Object
loci.formats.in.DynamicMetadataOptions
- All Implemented Interfaces:
MetadataOptions
Configuration object for readers and writers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerstatic final MetadataLevelstatic final Stringprivate Propertiesstatic final booleanstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionCreates an options object with metadata level set toMETADATA_LEVEL_DEFAULTand file validation set toREADER_VALIDATE_DEFAULT.Creates an options object with metadata level set to the specified value and file validation set toREADER_VALIDATE_DEFAULT -
Method Summary
Modifier and TypeMethodDescriptionGet the value of propertyname.Get the value of propertyname.getBoolean(String name) Get the value of propertynameas a Boolean.getBoolean(String name, Boolean defaultValue) Get the value of propertynameas a Boolean.Class<?> Get the value of propertynameas a class.Class<?> Get the value of propertynameas a class.Get the value of propertynameas a Double.Get the value of propertynameas a Double.<T extends Enum<T>>
TGet the value of propertynameas an enumerated type.Get the value of propertynameas a file object.Get the value of propertynameas a file object.Get the value of propertynameas a Float.Get the value of propertynameas a Float.getInteger(String name) Get the value of propertynameas an Integer.getInteger(String name, Integer defaultValue) Get the value of propertynameas an Integer.Get the value of propertynameas a Long.Get the value of propertynameas a Long.Get the configured metadata level.static StringbooleanChecks whether file validation has been set.voidloadOptions(String optionsFile, ArrayList<String> availableOptionKeys) voidSet propertynametovalue.voidsetBoolean(String name, Boolean value) Set propertynameto Booleanvalue.voidSet propertynameto Classvalue.voidSet propertynameto Doublevalue.<T extends Enum<T>>
voidSet propertynameto enumerated typevalue.voidSet propertynameto file objectvalue.voidSet propertynameto Floatvalue.voidsetInteger(String name, Integer value) Set propertynameto Integervalue.voidSet propertynameto Longvalue.voidsetMetadataLevel(MetadataLevel level) Set the metadata level.voidsetValidate(boolean validateMetadata) Specifies whether or not to validate files when reading.
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
METADATA_LEVEL_KEY
- See Also:
-
METADATA_LEVEL_DEFAULT
-
READER_VALIDATE_KEY
- See Also:
-
READER_VALIDATE_DEFAULT
public static final boolean READER_VALIDATE_DEFAULT- See Also:
-
props
-
-
Constructor Details
-
DynamicMetadataOptions
public DynamicMetadataOptions()Creates an options object with metadata level set toMETADATA_LEVEL_DEFAULTand file validation set toREADER_VALIDATE_DEFAULT. -
DynamicMetadataOptions
Creates an options object with metadata level set to the specified value and file validation set toREADER_VALIDATE_DEFAULT- Parameters:
level- theMetadataLevelto use.
-
-
Method Details
-
getMetadataLevel
Description copied from interface:MetadataOptionsGet the configured metadata level.- Specified by:
getMetadataLevelin interfaceMetadataOptions- Returns:
- the configured
MetadataLevel.
-
setMetadataLevel
Description copied from interface:MetadataOptionsSet the metadata level.- Specified by:
setMetadataLevelin interfaceMetadataOptions- Parameters:
level- aMetadataLevel.
-
isValidate
public boolean isValidate()Description copied from interface:MetadataOptionsChecks whether file validation has been set.- Specified by:
isValidatein interfaceMetadataOptions- Returns:
trueif files are validated when read,falseotherwise.
-
setValidate
public void setValidate(boolean validateMetadata) Description copied from interface:MetadataOptionsSpecifies whether or not to validate files when reading.- Specified by:
setValidatein interfaceMetadataOptions- Parameters:
validateMetadata-trueif files should be validated,falseotherwise.
-
set
Set propertynametovalue. Ifvalueisnullthe property will be removed.- Parameters:
name- property name.value- property value.- Throws:
IllegalArgumentException- ifnameisnull.
-
get
Get the value of propertyname.- Parameters:
name- property name.- Returns:
- property value, or
nullif the property does not exist.
-
get
Get the value of propertyname.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value, or
defaultValueif the property does not exist.
-
setEnum
Set propertynameto enumerated typevalue.- Parameters:
name- property name.value- property value.
-
getEnum
Get the value of propertynameas an enumerated type.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as an enumerated type, or
defaultValueif the property does not exist. - Throws:
IllegalArgumentException- if mapping is illegal for the type provided
-
setBoolean
Set propertynameto Booleanvalue.- Parameters:
name- property name.value- property value.
-
getBoolean
Get the value of propertynameas a Boolean.- Parameters:
name- property name.- Returns:
- property value as a Boolean, or
nullif the property does not exist. - Throws:
IllegalArgumentException- if value does not represent a Boolean.
-
getBoolean
Get the value of propertynameas a Boolean.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a Boolean, or
defaultValueif the property does not exist. - Throws:
IllegalArgumentException- if value does not represent a Boolean.
-
setInteger
Set propertynameto Integervalue.- Parameters:
name- property name.value- property value.
-
getInteger
Get the value of propertynameas an Integer.- Parameters:
name- property name.- Returns:
- property value as an Integer, or
nullif the property does not exist. - Throws:
NumberFormatException- if value does not represent an Integer.
-
getInteger
Get the value of propertynameas an Integer.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as an Integer, or
defaultValueif the property does not exist. - Throws:
NumberFormatException- if value does not represent an Integer.
-
setLong
Set propertynameto Longvalue.- Parameters:
name- property name.value- property value.
-
getLong
Get the value of propertynameas a Long.- Parameters:
name- property name.- Returns:
- property value as a Long, or
nullif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Long.
-
getLong
Get the value of propertynameas a Long.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a Long, or
defaultValueif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Long.
-
setFloat
Set propertynameto Floatvalue.- Parameters:
name- property name.value- property value.
-
getFloat
Get the value of propertynameas a Float.- Parameters:
name- property name.- Returns:
- property value as a Float, or
nullif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Float.
-
getFloat
Get the value of propertynameas a Float.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a Float, or
defaultValueif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Float.
-
setDouble
Set propertynameto Doublevalue.- Parameters:
name- property name.value- property value.
-
getDouble
Get the value of propertynameas a Double.- Parameters:
name- property name.- Returns:
- property value as a Double, or
nullif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Double.
-
getDouble
Get the value of propertynameas a Double.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a Double, or
defaultValueif the property does not exist. - Throws:
NumberFormatException- if value does not represent a Double.
-
setClass
Set propertynameto Classvalue.- Parameters:
name- property name.value- property value.
-
getClass
Get the value of propertynameas a class.- Parameters:
name- property name.- Returns:
- property value as a class, or
nullif the property does not exist. - Throws:
ClassNotFoundException- if value does not map to an existing class.
-
getClass
Get the value of propertynameas a class.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a class, or
defaultValueif the property does not exist. - Throws:
ClassNotFoundException- if value does not map to an existing class.
-
setFile
Set propertynameto file objectvalue.- Parameters:
name- property name.value- property value.
-
getFile
Get the value of propertynameas a file object.- Parameters:
name- property name.- Returns:
- property value as a
File, ornullif the property does not exist.
-
getFile
Get the value of propertynameas a file object.- Parameters:
name- property name.defaultValue- default value.- Returns:
- property value as a
File, ordefaultValueif the property does not exist.
-
loadOptions
public void loadOptions(String optionsFile, ArrayList<String> availableOptionKeys) throws IOException, FormatException - Throws:
IOExceptionFormatException
-
getMetadataOptionsFile
-