Package net.sf.jasperreports.engine.util
Class JRValueStringUtils
java.lang.Object
net.sf.jasperreports.engine.util.JRValueStringUtils
Utility class used to serialize/deserialize value objects to/from String values.
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.Time
Object of other types are serialized and the resulting binary data is converted into a String using the BASE64 encoding.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static classprotected static interface -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectdeserialize(String valueClass, String data) Converts a String back into a value.protected static JRValueStringUtils.ValueSerializergetSerializer(String valueClass) static booleanhasSerializer(String valueClass) Determines if there's a built-in serializer for the value type.static StringConverts a value into a String representation.
-
Field Details
-
EXCEPTION_MESSAGE_KEY_ERROR_PARSING_DATA
- See Also:
-
EXCEPTION_MESSAGE_KEY_VALUE_NOT_SERIALIZABLE
- See Also:
-
-
Method Details
-
hasSerializer
Determines if there's a built-in serializer for the value type.- Parameters:
valueClass- the value type- Returns:
- whether the value type is handled by a built-in serializer
-
serialize
Converts a value into a String representation.- Parameters:
valueClass- the type of the valuevalue- the value- Returns:
- the String representation of the value
-
deserialize
Converts a String back into a value.- Parameters:
valueClass- the type of the valuedata- the String representation of the value- Returns:
- the value
-
getSerializer
-