Package com.jidesoft.converter
Class ConverterContext
java.lang.Object
com.jidesoft.converter.AbstractContext
com.jidesoft.converter.ConverterContext
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionstatic ConverterContext
Default converter context with empty name and no user object.static ConverterContext
Deprecated. -
Constructor Summary
ConstructorsConstructorDescriptionConverterContext
(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
Modifier and TypeMethodDescriptionstatic ConverterContext
getArrayConverterContext
(ConverterContext context) Gets the converter context which add a trailing "[]" to the context name.static ConverterContext
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
-
Field Details
-
DEFAULT_CONTEXT
Default converter context with empty name and no user object. -
DEFAULT_CONTEXT_DYNAMIC_VALUE
Deprecated.Default converter context with dynamic value to work with EditorContext#DEFAULT_CONTEXT_DYNAMIC_VALUE.
-
-
Constructor Details
-
ConverterContext
Creates a converter context with a name.- Parameters:
name
- the name of the converter context
-
ConverterContext
Creates a converter context with a name and an object.- Parameters:
name
- the name of the converter contextobject
- the user object. It can be used as any object to pass information along.
-
-
Method Details
-
isArrayConverterContext
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
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
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.
-