Package org.joda.convert
Class TypeTokenStringConverter
java.lang.Object
org.joda.convert.TypeTokenStringConverter
- All Implemented Interfaces:
FromStringConverter<Object>,StringConverter<Object>,ToStringConverter<Object>,TypedFromStringConverter<Object>,TypedStringConverter<Object>
Parse the string format of Guava TypeToken.
This is loaded by reflection only when Guava is on the classpath. It relies on internal methods in Guava that could change in any release.
This parser is incomplete, but handles common cases. It does not handle union types or multi-dimensional arrays.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertFromString(Class<?> cls, String str) Converts the specified object from aString.convertToString(Object object) Converts the specified object to aString.Class<?> Gets the effective type that the converter works on.
-
Field Details
-
TYPE_TOKEN_CLASS
-
TYPE_TOKEN_METHOD_OF
-
-
Constructor Details
-
TypeTokenStringConverter
TypeTokenStringConverter()
-
-
Method Details
-
convertToString
Description copied from interface:ToStringConverterConverts the specified object to aString.- Specified by:
convertToStringin interfaceToStringConverter<Object>- Parameters:
object- the object to convert, not null- Returns:
- the converted string, may be null but generally not
-
convertFromString
Description copied from interface:FromStringConverterConverts the specified object from aString.- Specified by:
convertFromStringin interfaceFromStringConverter<Object>- Parameters:
cls- the class to convert to, not nullstr- the string to convert, not null- Returns:
- the converted object, may be null but generally not
-
getEffectiveType
Description copied from interface:TypedStringConverterGets the effective type that the converter works on.For example, if a class declares the
FromStringandToStringthen the effective type of the converter is that class. If a subclass is queried for a converter, then the effective type is that of the superclass.- Specified by:
getEffectiveTypein interfaceTypedFromStringConverter<Object>- Specified by:
getEffectiveTypein interfaceTypedStringConverter<Object>- Returns:
- the effective type
-