loci.formats.in

## Class DynamicMetadataOptions

- java.lang.Object
- - loci.formats.in.DynamicMetadataOptions

- All Implemented Interfaces:
    MetadataOptions

      public class DynamicMetadataOptions
      extends java.lang.Object
      implements MetadataOptions

  Configuration object for readers and writers.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `LOGGER`
    `static MetadataLevel` | `METADATA_LEVEL_DEFAULT`
    `static java.lang.String` | `METADATA_LEVEL_KEY`
    `private java.util.Properties` | `props`
    `static boolean` | `READER_VALIDATE_DEFAULT`
    `static java.lang.String` | `READER_VALIDATE_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DynamicMetadataOptions()` Creates an options object with metadata level set to `METADATA_LEVEL_DEFAULT` and file validation set to `READER_VALIDATE_DEFAULT`.
    `DynamicMetadataOptions(MetadataLevel level)` Creates an options object with metadata level set to the specified value and file validation set to `READER_VALIDATE_DEFAULT`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `get(java.lang.String name)` Get the value of property `name`.
    `java.lang.String` | `get(java.lang.String name, java.lang.String defaultValue)` Get the value of property `name`.
    `java.lang.Boolean` | `getBoolean(java.lang.String name)` Get the value of property `name` as a Boolean.
    `java.lang.Boolean` | `getBoolean(java.lang.String name, java.lang.Boolean defaultValue)` Get the value of property `name` as a Boolean.
    `java.lang.Class<?>` | `getClass(java.lang.String name)` Get the value of property `name` as a class.
    `java.lang.Class<?>` | `getClass(java.lang.String name, java.lang.Class<?> defaultValue)` Get the value of property `name` as a class.
    `java.lang.Double` | `getDouble(java.lang.String name)` Get the value of property `name` as a Double.
    `java.lang.Double` | `getDouble(java.lang.String name, java.lang.Double defaultValue)` Get the value of property `name` as a Double.
    `<T extends java.lang.Enum<T>> T` | `getEnum(java.lang.String name, T defaultValue)` Get the value of property `name` as an enumerated type.
    `java.io.File` | `getFile(java.lang.String name)` Get the value of property `name` as a file object.
    `java.io.File` | `getFile(java.lang.String name, java.io.File defaultValue)` Get the value of property `name` as a file object.
    `java.lang.Float` | `getFloat(java.lang.String name)` Get the value of property `name` as a Float.
    `java.lang.Float` | `getFloat(java.lang.String name, java.lang.Float defaultValue)` Get the value of property `name` as a Float.
    `java.lang.Integer` | `getInteger(java.lang.String name)` Get the value of property `name` as an Integer.
    `java.lang.Integer` | `getInteger(java.lang.String name, java.lang.Integer defaultValue)` Get the value of property `name` as an Integer.
    `java.lang.Long` | `getLong(java.lang.String name)` Get the value of property `name` as a Long.
    `java.lang.Long` | `getLong(java.lang.String name, java.lang.Long defaultValue)` Get the value of property `name` as a Long.
    `MetadataLevel` | `getMetadataLevel()` Get the configured metadata level.
    `static java.lang.String` | `getMetadataOptionsFile(java.lang.String id)`
    `boolean` | `isValidate()` Checks whether file validation has been set.
    `void` | `loadOptions(java.lang.String optionsFile, java.util.ArrayList<java.lang.String> availableOptionKeys)`
    `void` | `set(java.lang.String name, java.lang.String value)` Set property `name` to `value`.
    `void` | `setBoolean(java.lang.String name, java.lang.Boolean value)` Set property `name` to Boolean `value`.
    `void` | `setClass(java.lang.String name, java.lang.Class<?> value)` Set property `name` to Class `value`.
    `void` | `setDouble(java.lang.String name, java.lang.Double value)` Set property `name` to Double `value`.
    `<T extends java.lang.Enum<T>> void` | `setEnum(java.lang.String name, T value)` Set property `name` to enumerated type `value`.
    `void` | `setFile(java.lang.String name, java.io.File value)` Set property `name` to file object `value`.
    `void` | `setFloat(java.lang.String name, java.lang.Float value)` Set property `name` to Float `value`.
    `void` | `setInteger(java.lang.String name, java.lang.Integer value)` Set property `name` to Integer `value`.
    `void` | `setLong(java.lang.String name, java.lang.Long value)` Set property `name` to Long `value`.
    `void` | `setMetadataLevel(MetadataLevel level)` Set the metadata level.
    `void` | `setValidate(boolean validateMetadata)` Specifies whether or not to validate files when reading.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGGER

          protected static final org.slf4j.Logger LOGGER

    - #### METADATA_LEVEL_KEY

          public static final java.lang.String METADATA_LEVEL_KEY

      See Also:
        Constant Field Values

    - #### METADATA_LEVEL_DEFAULT

          public static final MetadataLevel METADATA_LEVEL_DEFAULT

    - #### READER_VALIDATE_KEY

          public static final java.lang.String READER_VALIDATE_KEY

      See Also:
        Constant Field Values

    - #### READER_VALIDATE_DEFAULT

          public static final boolean READER_VALIDATE_DEFAULT

      See Also:
        Constant Field Values

    - #### props

          private java.util.Properties props

  - ### Constructor Detail

    - #### DynamicMetadataOptions

          public DynamicMetadataOptions()

      Creates an options object with metadata level set to `METADATA_LEVEL_DEFAULT` and file validation set to `READER_VALIDATE_DEFAULT`.

    - #### DynamicMetadataOptions

          public DynamicMetadataOptions(MetadataLevel level)

      Creates an options object with metadata level set to the specified value and file validation set to `READER_VALIDATE_DEFAULT`
      Parameters:
        `level` - the `MetadataLevel` to use.

  - ### Method Detail

    - #### getMetadataLevel

          public MetadataLevel getMetadataLevel()

      Description copied from interface: `MetadataOptions`
      Get the configured metadata level.
      Specified by:
        `getMetadataLevel` in interface `MetadataOptions`
      Returns:
        the configured `MetadataLevel`.

    - #### setMetadataLevel

          public void setMetadataLevel(MetadataLevel level)

      Description copied from interface: `MetadataOptions`
      Set the metadata level.
      Specified by:
        `setMetadataLevel` in interface `MetadataOptions`
      Parameters:
        `level` - a `MetadataLevel`.

    - #### isValidate

          public boolean isValidate()

      Description copied from interface: `MetadataOptions`
      Checks whether file validation has been set.
      Specified by:
        `isValidate` in interface `MetadataOptions`
      Returns:
        `true` if files are validated when read, `false` otherwise.

    - #### setValidate

          public void setValidate(boolean validateMetadata)

      Description copied from interface: `MetadataOptions`
      Specifies whether or not to validate files when reading.
      Specified by:
        `setValidate` in interface `MetadataOptions`
      Parameters:
        `validateMetadata` - `true` if files should be validated, `false` otherwise.

    - #### set

          public void set(java.lang.String name,
                          java.lang.String value)

      Set property `name` to `value`. If `value` is `null` the property will be removed.
      Parameters:
        `name` - property name.
        `value` - property value.
      Throws:
        `java.lang.IllegalArgumentException` - if `name` is `null`.

    - #### get

          public java.lang.String get(java.lang.String name)

      Get the value of property `name`.
      Parameters:
        `name` - property name.
      Returns:
        property value, or `null` if the property does not exist.

    - #### get

          public java.lang.String get(java.lang.String name,
                                      java.lang.String defaultValue)

      Get the value of property `name`.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value, or `defaultValue` if the property does not exist.

    - #### setEnum

          public <T extends java.lang.Enum<T>> void setEnum(java.lang.String name,
                                                            T value)

      Set property `name` to enumerated type `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getEnum

          public <T extends java.lang.Enum<T>> T getEnum(java.lang.String name,
                                                         T defaultValue)

      Get the value of property `name` as an enumerated type.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as an enumerated type, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.IllegalArgumentException` - if mapping is illegal for the type provided

    - #### setBoolean

          public void setBoolean(java.lang.String name,
                                 java.lang.Boolean value)

      Set property `name` to Boolean `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getBoolean

          public java.lang.Boolean getBoolean(java.lang.String name)

      Get the value of property `name` as a Boolean.
      Parameters:
        `name` - property name.
      Returns:
        property value as a Boolean, or `null` if the property does not exist.
      Throws:
        `java.lang.IllegalArgumentException` - if value does not represent a Boolean.

    - #### getBoolean

          public java.lang.Boolean getBoolean(java.lang.String name,
                                              java.lang.Boolean defaultValue)

      Get the value of property `name` as a Boolean.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a Boolean, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.IllegalArgumentException` - if value does not represent a Boolean.

    - #### setInteger

          public void setInteger(java.lang.String name,
                                 java.lang.Integer value)

      Set property `name` to Integer `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getInteger

          public java.lang.Integer getInteger(java.lang.String name)

      Get the value of property `name` as an Integer.
      Parameters:
        `name` - property name.
      Returns:
        property value as an Integer, or `null` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent an Integer.

    - #### getInteger

          public java.lang.Integer getInteger(java.lang.String name,
                                              java.lang.Integer defaultValue)

      Get the value of property `name` as an Integer.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as an Integer, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent an Integer.

    - #### setLong

          public void setLong(java.lang.String name,
                              java.lang.Long value)

      Set property `name` to Long `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getLong

          public java.lang.Long getLong(java.lang.String name)

      Get the value of property `name` as a Long.
      Parameters:
        `name` - property name.
      Returns:
        property value as a Long, or `null` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Long.

    - #### getLong

          public java.lang.Long getLong(java.lang.String name,
                                        java.lang.Long defaultValue)

      Get the value of property `name` as a Long.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a Long, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Long.

    - #### setFloat

          public void setFloat(java.lang.String name,
                               java.lang.Float value)

      Set property `name` to Float `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getFloat

          public java.lang.Float getFloat(java.lang.String name)

      Get the value of property `name` as a Float.
      Parameters:
        `name` - property name.
      Returns:
        property value as a Float, or `null` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Float.

    - #### getFloat

          public java.lang.Float getFloat(java.lang.String name,
                                          java.lang.Float defaultValue)

      Get the value of property `name` as a Float.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a Float, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Float.

    - #### setDouble

          public void setDouble(java.lang.String name,
                                java.lang.Double value)

      Set property `name` to Double `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getDouble

          public java.lang.Double getDouble(java.lang.String name)

      Get the value of property `name` as a Double.
      Parameters:
        `name` - property name.
      Returns:
        property value as a Double, or `null` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Double.

    - #### getDouble

          public java.lang.Double getDouble(java.lang.String name,
                                            java.lang.Double defaultValue)

      Get the value of property `name` as a Double.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a Double, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.NumberFormatException` - if value does not represent a Double.

    - #### setClass

          public void setClass(java.lang.String name,
                               java.lang.Class<?> value)

      Set property `name` to Class `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getClass

          public java.lang.Class<?> getClass(java.lang.String name)
                                      throws java.lang.ClassNotFoundException

      Get the value of property `name` as a class.
      Parameters:
        `name` - property name.
      Returns:
        property value as a class, or `null` if the property does not exist.
      Throws:
        `java.lang.ClassNotFoundException` - if value does not map to an existing class.

    - #### getClass

          public java.lang.Class<?> getClass(java.lang.String name,
                                             java.lang.Class<?> defaultValue)
                                      throws java.lang.ClassNotFoundException

      Get the value of property `name` as a class.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a class, or `defaultValue` if the property does not exist.
      Throws:
        `java.lang.ClassNotFoundException` - if value does not map to an existing class.

    - #### setFile

          public void setFile(java.lang.String name,
                              java.io.File value)

      Set property `name` to file object `value`.
      Parameters:
        `name` - property name.
        `value` - property value.

    - #### getFile

          public java.io.File getFile(java.lang.String name)

      Get the value of property `name` as a file object.
      Parameters:
        `name` - property name.
      Returns:
        property value as a `File`, or `null` if the property does not exist.

    - #### getFile

          public java.io.File getFile(java.lang.String name,
                                      java.io.File defaultValue)

      Get the value of property `name` as a file object.
      Parameters:
        `name` - property name.
        `defaultValue` - default value.
      Returns:
        property value as a `File`, or `defaultValue` if the property does not exist.

    - #### loadOptions

          public void loadOptions(java.lang.String optionsFile,
                                  java.util.ArrayList<java.lang.String> availableOptionKeys)
                           throws java.io.IOException,
                                  FormatException

      Throws:
        `java.io.IOException`
        `FormatException`

    - #### getMetadataOptionsFile

          public static java.lang.String getMetadataOptionsFile(java.lang.String id)

Copyright © 2026 Open Microscopy Environment