Class MultipleEnumConverter

java.lang.Object
com.jidesoft.converter.ArrayConverter
com.jidesoft.converter.MultipleEnumConverter
All Implemented Interfaces:
ObjectConverter

public class MultipleEnumConverter extends ArrayConverter
MultipleEnumConverter is a special ArrayConverter that converts a string to/from array. Each element in the element is converted to the object using a specified EnumConverter.
  • Constructor Details

    • MultipleEnumConverter

      public MultipleEnumConverter(String separator, EnumConverter converter)
  • Method Details

    • getType

      public Class<?> getType()
    • getEnumConverter

      public EnumConverter getEnumConverter()
    • setEnumConverter

      public void setEnumConverter(EnumConverter enumConverter)
    • toString

      public String toString(Object object, ConverterContext context)
      Description copied from interface: ObjectConverter
      Converts from object to String based on current locale.
      Parameters:
      object - object to be converted
      context - converter context to be used
      Returns:
      the String
    • supportToString

      public boolean supportToString(Object object, ConverterContext context)
      Description copied from interface: ObjectConverter
      If it supports toString method.
      Parameters:
      object - object to be converted
      context - converter context to be used
      Returns:
      true if supports toString
    • fromString

      public Object fromString(String string, ConverterContext context)
      Description copied from interface: ObjectConverter
      Converts from String to an object.
      Parameters:
      string - the string
      context - context to be converted
      Returns:
      the object converted from string
    • supportFromString

      public boolean supportFromString(String string, ConverterContext context)
      Description copied from interface: ObjectConverter
      If it supports fromString.
      Parameters:
      string - the string
      context - context to be converted
      Returns:
      true if it supports
    • toString

      protected String toString(int i, Object o, ConverterContext context)
      Overrides:
      toString in class ArrayConverter
    • fromString

      protected Object fromString(int i, String s, ConverterContext context)
      Overrides:
      fromString in class ArrayConverter
    • getContext

      public ConverterContext getContext()
      Gets the converter context of this converter. The name of the context is the name of the converter where you pass in to EnumConverter's constructor.
      Returns:
      the converter context of this converter.