Class DynamicMetadataOptions

java.lang.Object
loci.formats.in.DynamicMetadataOptions
All Implemented Interfaces:
MetadataOptions

public class DynamicMetadataOptions extends Object implements MetadataOptions
Configuration object for readers and writers.
  • Field Details

  • Constructor Details

  • Method Details

    • 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(String name, String value)
      Set property name to value. If value is null the property will be removed.
      Parameters:
      name - property name.
      value - property value.
      Throws:
      IllegalArgumentException - if name is null.
    • get

      public String get(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 String get(String name, 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 Enum<T>> void setEnum(String name, T value)
      Set property name to enumerated type value.
      Parameters:
      name - property name.
      value - property value.
    • getEnum

      public <T extends Enum<T>> T getEnum(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:
      IllegalArgumentException - if mapping is illegal for the type provided
    • setBoolean

      public void setBoolean(String name, Boolean value)
      Set property name to Boolean value.
      Parameters:
      name - property name.
      value - property value.
    • getBoolean

      public Boolean getBoolean(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:
      IllegalArgumentException - if value does not represent a Boolean.
    • getBoolean

      public Boolean getBoolean(String name, 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:
      IllegalArgumentException - if value does not represent a Boolean.
    • setInteger

      public void setInteger(String name, Integer value)
      Set property name to Integer value.
      Parameters:
      name - property name.
      value - property value.
    • getInteger

      public Integer getInteger(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:
      NumberFormatException - if value does not represent an Integer.
    • getInteger

      public Integer getInteger(String name, 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:
      NumberFormatException - if value does not represent an Integer.
    • setLong

      public void setLong(String name, Long value)
      Set property name to Long value.
      Parameters:
      name - property name.
      value - property value.
    • getLong

      public Long getLong(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:
      NumberFormatException - if value does not represent a Long.
    • getLong

      public Long getLong(String name, 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:
      NumberFormatException - if value does not represent a Long.
    • setFloat

      public void setFloat(String name, Float value)
      Set property name to Float value.
      Parameters:
      name - property name.
      value - property value.
    • getFloat

      public Float getFloat(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:
      NumberFormatException - if value does not represent a Float.
    • getFloat

      public Float getFloat(String name, 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:
      NumberFormatException - if value does not represent a Float.
    • setDouble

      public void setDouble(String name, Double value)
      Set property name to Double value.
      Parameters:
      name - property name.
      value - property value.
    • getDouble

      public Double getDouble(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:
      NumberFormatException - if value does not represent a Double.
    • getDouble

      public Double getDouble(String name, 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:
      NumberFormatException - if value does not represent a Double.
    • setClass

      public void setClass(String name, Class<?> value)
      Set property name to Class value.
      Parameters:
      name - property name.
      value - property value.
    • getClass

      public Class<?> getClass(String name) throws 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:
      ClassNotFoundException - if value does not map to an existing class.
    • getClass

      public Class<?> getClass(String name, Class<?> defaultValue) throws 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:
      ClassNotFoundException - if value does not map to an existing class.
    • setFile

      public void setFile(String name, File value)
      Set property name to file object value.
      Parameters:
      name - property name.
      value - property value.
    • getFile

      public File getFile(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 File getFile(String name, 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(String optionsFile, ArrayList<String> availableOptionKeys) throws IOException, FormatException
      Throws:
      IOException
      FormatException
    • getMetadataOptionsFile

      public static String getMetadataOptionsFile(String id)