Class ConverterContext

java.lang.Object
com.jidesoft.converter.AbstractContext
com.jidesoft.converter.ConverterContext
All Implemented Interfaces:
Serializable

public class ConverterContext extends AbstractContext
The context object used by ObjectConverter. For the same type, we may need different way to convert them. This context is used so that user can register different converters for the same type.
See Also:
  • Field Details

    • DEFAULT_CONTEXT

      public static ConverterContext DEFAULT_CONTEXT
      Default converter context with empty name and no user object.
    • DEFAULT_CONTEXT_DYNAMIC_VALUE

      @Deprecated public static ConverterContext DEFAULT_CONTEXT_DYNAMIC_VALUE
      Deprecated.
      Default converter context with dynamic value to work with EditorContext#DEFAULT_CONTEXT_DYNAMIC_VALUE.
  • Constructor Details

    • ConverterContext

      public ConverterContext(String name)
      Creates a converter context with a name.
      Parameters:
      name - the name of the converter context
    • ConverterContext

      public ConverterContext(String name, Object object)
      Creates a converter context with a name and an object.
      Parameters:
      name - the name of the converter context
      object - the user object. It can be used as any object to pass information along.
  • Method Details

    • isArrayConverterContext

      public static boolean isArrayConverterContext(ConverterContext context)
      Checks if the context is for an array. By conversion, we put "[]" at the end of the converter context's name if the context is for an array data type. Please note, this is a conversion only. If developer chooses to not put "[]" at the end for their own customized context, this method will fail.
      Parameters:
      context - the context.
      Returns:
      true or false.
    • getElementConverterContext

      public static ConverterContext getElementConverterContext(ConverterContext context)
      Gets the converter context which removes the trailing "[]" from the context name.
      Parameters:
      context - the context for an array type.
      Returns:
      the converter context for the element type of an array.
    • getArrayConverterContext

      public static ConverterContext getArrayConverterContext(ConverterContext context)
      Gets the converter context which add a trailing "[]" to the context name.
      Parameters:
      context - the context for the element type of an array.
      Returns:
      the converter context the array of the element type.