public final class JRValueStringUtils extends Object
Specific logic is used to convert to and from Strings values of the following types:
java.lang.Stringjava.lang.Characterjava.lang.Booleanjava.lang.Bytejava.lang.Shortjava.lang.Integerjava.lang.Longjava.lang.Floatjava.lang.Doublejava.math.BigIntegerjava.math.BigDecimaljava.util.Datejava.sql.Timestampjava.sql.TimeObject of other types are serialized and the resulting binary data is converted into a String using the BASE64 encoding.
| Modifier and Type | Field and Description |
|---|---|
static String |
EXCEPTION_MESSAGE_KEY_ERROR_PARSING_DATA |
static String |
EXCEPTION_MESSAGE_KEY_VALUE_NOT_SERIALIZABLE |
| Modifier and Type | Method and Description |
|---|---|
static Object |
deserialize(String valueClass,
String data)
Converts a String back into a value.
|
protected static JRValueStringUtils.ValueSerializer |
getSerializer(String valueClass) |
static boolean |
hasSerializer(String valueClass)
Determines if there's a built-in serializer for the value type.
|
static String |
serialize(String valueClass,
Object value)
Converts a value into a String representation.
|
public static final String EXCEPTION_MESSAGE_KEY_ERROR_PARSING_DATA
public static final String EXCEPTION_MESSAGE_KEY_VALUE_NOT_SERIALIZABLE
public static boolean hasSerializer(String valueClass)
valueClass - the value typepublic static String serialize(String valueClass, Object value)
valueClass - the type of the valuevalue - the valuepublic static Object deserialize(String valueClass, String data)
valueClass - the type of the valuedata - the String representation of the valueprotected static JRValueStringUtils.ValueSerializer getSerializer(String valueClass)
Copyright © 2017. All rights reserved.