public final class JRValueStringUtils extends Object
Specific logic is used to convert to and from Strings values of the following types:
java.lang.String
java.lang.Character
java.lang.Boolean
java.lang.Byte
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.math.BigInteger
java.math.BigDecimal
java.util.Date
java.sql.Timestamp
java.sql.Time
Object 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.