Class EnumConverter<E extends Enum<E>>

java.lang.Object
javafx.css.StyleConverter<String,E>
javafx.css.converter.EnumConverter<E>

public final class EnumConverter<E extends Enum<E>> extends StyleConverter<String,E>
Converter to convert a string representation of an Enum to an Enum.
Since:
9
  • Constructor Details

    • EnumConverter

      public EnumConverter(Class<E> enumClass)
      Creates an EnumConvertor object.
      Parameters:
      enumClass - enum class
  • Method Details

    • readBinary

      public static StyleConverter<?,?> readBinary(DataInputStream is, String[] strings) throws IOException
      Reads binary StyleConverter data from a given DataInputStream.
      Parameters:
      is - DataInputStream to read StyleConverter data from
      strings - string array containing StyleConverter details
      Returns:
      a StyleConverter from read binary data
      Throws:
      IOException - if reading from DataInputStream fails
    • getInstance

      public static StyleConverter<?,?> getInstance(String ename)
      Gets an EnumConverter instance for a given enum name.
      Parameters:
      ename - enum name
      Returns:
      an EnumConverter instance for a given enum name.