Top Description Fields Constructors Methods
org.joda.convert

pack-priv final Class TypeTokenStringConverter

extends Object
implements TypedStringConverter<Object>
Class Inheritance
All Implemented Interfaces
org.joda.convert.TypedStringConverter, org.joda.convert.TypedFromStringConverter, org.joda.convert.FromStringConverter, org.joda.convert.StringConverter, org.joda.convert.ToStringConverter
Imports
java.lang.reflect.Method, .Type

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

Modifier and TypeField and Description
pack-priv static final Class<?>
pack-priv static final Method

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Object
convertFromString(Class<?>
the class to convert to, not null
cls
,
String
the string to convert, not null
str
)

Implements org.joda.convert.FromStringConverter.convertFromString.

Converts the specified object from a String.
public String
convertToString(Object
the object to convert, not null
object
)

Implements org.joda.convert.ToStringConverter.convertToString.

Converts the specified object to a String.
public Class<?>
getEffectiveType()

Implements org.joda.convert.TypedStringConverter.getEffectiveType.

Gets the effective type that the converter works on.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

TYPE_TOKEN_CLASSback to summary
pack-priv static final Class<?> TYPE_TOKEN_CLASS
TYPE_TOKEN_METHOD_OFback to summary
pack-priv static final Method TYPE_TOKEN_METHOD_OF

Constructor Detail

TypeTokenStringConverterback to summary
pack-priv TypeTokenStringConverter()

Method Detail

convertFromStringback to summary
public Object convertFromString(Class<?> cls, String str)

Implements org.joda.convert.FromStringConverter.convertFromString.

Doc from org.joda.convert.FromStringConverter.convertFromString.

Converts the specified object from a String.

Parameters
cls:Class<?>

the class to convert to, not null

str:String

the string to convert, not null

Returns:Object

the converted object, may be null but generally not

Annotations
@Override
convertToStringback to summary
public String convertToString(Object object)

Implements org.joda.convert.ToStringConverter.convertToString.

Doc from org.joda.convert.ToStringConverter.convertToString.

Converts the specified object to a String.

Parameters
object:Object

the object to convert, not null

Returns:String

the converted string, may be null but generally not

Annotations
@Override
getEffectiveTypeback to summary
public Class<?> getEffectiveType()

Implements org.joda.convert.TypedStringConverter.getEffectiveType.

Doc from org.joda.convert.TypedStringConverter.getEffectiveType.

Gets the effective type that the converter works on.

For example, if a class declares the FromString and ToString then 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.

Returns:Class<?>

the effective type

Annotations
@Override