public class BasicTypeConverter extends java.lang.Object implements TypeConverter
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
BasicTypeConverter.ValueNodeSet
NodeSet implementation
|
(package private) static class |
BasicTypeConverter.ValuePointer
Value pointer
|
| Constructor and Description |
|---|
BasicTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection |
allocateCollection(java.lang.Class type)
Create a collection of a given type.
|
protected java.lang.Number |
allocateNumber(java.lang.Class type,
double value)
Allocate a number of a given type and value.
|
boolean |
canConvert(java.lang.Object object,
java.lang.Class toType)
Returns true if it can convert the supplied
object to the specified class.
|
protected boolean |
canCreateCollection(java.lang.Class type)
Learn whether this BasicTypeConverter can create a collection of the specified type.
|
java.lang.Object |
convert(java.lang.Object object,
java.lang.Class toType)
Converts the supplied object to the specified
type.
|
protected java.lang.Object |
convertNullToPrimitive(java.lang.Class toType)
Convert null to a primitive type.
|
protected java.lang.Object |
convertStringToPrimitive(java.lang.Object object,
java.lang.Class toType)
Convert a string to a primitive type.
|
protected java.util.Collection |
unmodifiableCollection(java.util.Collection collection)
Get an unmodifiable version of a collection.
|
public boolean canConvert(java.lang.Object object,
java.lang.Class toType)
canConvert in interface TypeConverterobject - to checktoType - prospective destination classpublic java.lang.Object convert(java.lang.Object object,
java.lang.Class toType)
convert in interface TypeConverterobject - to converttoType - destination classprotected java.lang.Object convertNullToPrimitive(java.lang.Class toType)
toType - destination classprotected java.lang.Object convertStringToPrimitive(java.lang.Object object,
java.lang.Class toType)
object - StringtoType - destination classprotected java.lang.Number allocateNumber(java.lang.Class type,
double value)
type - destination classvalue - doubleprotected boolean canCreateCollection(java.lang.Class type)
type - prospective destination classprotected java.util.Collection allocateCollection(java.lang.Class type)
type - destination classprotected java.util.Collection unmodifiableCollection(java.util.Collection collection)
collection - to wrap