JIDE 3.5.15

com.jidesoft.converter
Class ConverterContext

java.lang.Object
  extended by com.jidesoft.converter.AbstractContext
      extended by 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:
Serialized Form

Field Summary
static ConverterContext DEFAULT_CONTEXT
          Default converter context with empty name and no user object.
static ConverterContext DEFAULT_CONTEXT_DYNAMIC_VALUE
          Deprecated. 
 
Constructor Summary
ConverterContext(String name)
          Creates a converter context with a name.
ConverterContext(String name, Object object)
          Creates a converter context with a name and an object.
 
Method Summary
static ConverterContext getArrayConverterContext(ConverterContext context)
          Gets the converter context which add a trailing "[]" to the context name.
static ConverterContext getElementConverterContext(ConverterContext context)
          Gets the converter context which removes the trailing "[]" from the context name.
static boolean isArrayConverterContext(ConverterContext context)
          Checks if the context is for an array.
 
Methods inherited from class com.jidesoft.converter.AbstractContext
equals, getName, getUserObject, hashCode, setName, setUserObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

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 Detail

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.

JIDE 3.5.15