Package org.joda.convert
Class TypeStringConverterFactory
java.lang.Object
org.joda.convert.TypeStringConverterFactory
- All Implemented Interfaces:
StringConverterFactory
Factory for
StringConverter looking up types.
This class is immutable and thread-safe.
This parses the string format of Type.
This is achieved thanks to some code copied from Guava. (A Guava dependency is painful when building a Java 6 library for Java 9)
This parser is incomplete, but handles common cases. It does not handle union types or multi-dimensional arrays.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final TypeStringConverterFactorySingleton instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindConverter(Class<?> cls) Finds a converter by type.toString()
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Constructor Details
-
TypeStringConverterFactory
private TypeStringConverterFactory()Restricted constructor.
-
-
Method Details
-
findConverter
Finds a converter by type.- Specified by:
findConverterin interfaceStringConverterFactory- Parameters:
cls- the type to lookup, not null- Returns:
- the converter, null if not found
- Throws:
RuntimeException- (or subclass) if source code is invalid
-
toString
-