Generated by
JDiff

org.springframework.core.convert Documentation Differences

This file contains all the changes in documentation in the package org.springframework.core.convert as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class ConversionService

A service interface for type conversion. This is the entry point into the convert system. Call .convert(Object, Class) to perform a thread-safe type conversion using this system. @author Keith Donald @author Phillip Webb @since 3.0

Class ConverterNotFoundException, constructor ConverterNotFoundException(TypeDescriptor, TypeDescriptor)

Creates a new conversion executor not found exception. @param sourceType the source type requested to convert from @param targetType the target type requested to convert to @param message a descriptive messageto

Class Property

A description of a JavaBeans Property that allows us to avoid a dependency on java.beans.PropertyDescriptor. The java.beans package is not available in a number of environments (e.g. Android, Java ME), so this is desirable for portability of Spring's core conversion facility.

Used to build a TypeDescriptor from a property location. The built TypeDescriptor can then be used to convert from/to the property type. @author Keith Donald @author Phillip Webb @since 3.1 @see TypeDescriptor#TypeDescriptor(Property) @see TypeDescriptor#nested(Property, int)


Class TypeDescriptor, constructor TypeDescriptor(MethodParameter)

Create a new type descriptor from a MethodParameter. Use this constructor when a source or target conversion point is a constructor parameter, method parameter, or method return value. @param methodParameter the method parameter
Class TypeDescriptor, TypeDescriptor elementTypeDescriptor(Object)

If this type is a Collection or an Array, creates a element TypeDescriptor from the provided collection or array element. Narrows the elementType property to the class of the provided collection or array element. For example, if this describes a java.util.List<java.lang.Number< and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer. If this describes a java.util.List<?> and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well. Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned. @param element the collection or array element @return a element type descriptor, narrowed to the type of the provided element @throws IllegalStateException if this type is not a java.util.Collection or Array type @see #narrow(Object)
Class TypeDescriptor, TypeDescriptor forObject(Object)

Create a new type descriptor for an object. Use this factory method to introspect a source object before asking the conversion system to convert it to some another type. If the provided object is null, returns null, else calls .valueOf(Class) to build a TypeDescriptor from the object's class. @param objectsource the source object @return the type descriptor
Class TypeDescriptor, Annotation getAnnotation(Class<T>)

Obtain the annotation associated with this type descriptor of the specified type. @param annotationType the annotation type @return the annotation, or null if no such annotation exists on this type descriptor.
Class TypeDescriptor, Annotation[] getAnnotations()

The annotations associated with this type descriptor, if any. @return the annotations, or an empty array if none.
Class TypeDescriptor, Class<?> getElementType()

Returns the value of getType() for the elementTypeDescriptor. @deprecated in Spring 3.1 in favor of .getElementTypeDescriptor(). @throws IllegalStateException if this type is not a java.util.Collection or Array type
Class TypeDescriptor, TypeDescriptor getElementTypeDescriptor()

If this type is an array, returns the array's component type. If this type is a Collection and it is parameterized, returns the Collection's element type. If the Collection is not parameterized, returns null indicating the element type is not declared. @return the array component type or Collection element type, or null if this type is a Collection but its element type is not parameterized. parameterized @throws IllegalStateException if this type is not a java.util.Collection or Array type
Class TypeDescriptor, Class<?> getMapKeyType()

Returns the value of getType() for the getMapKeyTypeDescriptor. @deprecated in Spring 3.1 in favor of .getMapKeyTypeDescriptor(). @throws IllegalStateException if this type is not a java.util.Map.
Class TypeDescriptor, TypeDescriptor getMapKeyTypeDescriptor()

If this type is a Map and its key type is parameterized, returns the map's key type. If the Map's key type is not parameterized, returns null indicating the key type is not declared. @return the Map key type, or null if this type is a Map but its key type is not parameterized. parameterized @throws IllegalStateException if this type is not a java.util.Map.
Class TypeDescriptor, TypeDescriptor getMapKeyTypeDescriptor(Object)

If this type is a Map, creates a mapKey TypeDescriptor from the provided map key. Narrows the mapKeyType property to the class of the provided map key. For example, if this describes a java.util.Map<java.lang.Number, java.lang.String< and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer. If this describes a java.util.Map<?, ?> and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well. Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned. @param mapKey the map key @return the map key type descriptor @throws IllegalStateException if this type is not a java.util.Map. Map @see #narrow(Object)
Class TypeDescriptor, Class<?> getMapValueType()

Returns the value of getType() for the getMapValueTypeDescriptor. @deprecated in Spring 3.1 in favor of .getMapValueTypeDescriptor(). @throws IllegalStateException if this type is not a java.util.Map.
Class TypeDescriptor, TypeDescriptor getMapValueTypeDescriptor()

If this type is a Map and its value type is parameterized, returns the map's value type. If the Map's value type is not parameterized, returns null indicating the value type is not declared. @return the Map value type, or null if this type is a Map but its value type is not parameterized. parameterized @throws IllegalStateException if this type is not a java.util.Map.
Class TypeDescriptor, TypeDescriptor getMapValueTypeDescriptor(Object)

If this type is a Map, creates a mapValue TypeDescriptor from the provided map value. Narrows the mapValueType property to the class of the provided map value. For example, if this describes a java.util.Map<java.lang.String, java.lang.Number< and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer. If this describes a java.util.Map<?, ?> and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well. Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned. @param mapValue the map value @return the map value type descriptor @throws IllegalStateException if this type is not a java.util.Map.
Class TypeDescriptor, Class<?> getObjectType()

Variation of .getType() that accounts for a primitive type by returning its object wrapper type.

This is useful for conversion service implementations that wish to normalize to object-based typestypes and not work with primitive types directly.

Class TypeDescriptor, Class<?> getType()

The type of the backing class, method parameter, field, or property described by this TypeDescriptor. Returns primitive types as-is.

See .getObjectType() for a variation of this operation that resolves primitive typestypes to their corresponding Object types if necessary. @return the type, or null if this is TypeDescriptor.NULL @see #getObjectType()

Class TypeDescriptor, boolean isAssignableTo(TypeDescriptor)

Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor. For example, valueOf(String.class).isAssignableTo(valueOf(CharSequence.class)) returns true because a String value can be assigned to a CharSequence variable. On the other hand, valueOf(Number.class).isAssignableTo(valueOf(Integer.class)) returns false because, while all Integers are Numbers, not all Numbers are Integers.

For arrays, collections, and maps, element and key/value types are checked if declared. For example, a List<String> field value is assignable to a Collection<CharSequence> field, but List<Number> is not assignable to List<Integer>. @return true if this type is assignable to the type represented by the provided type descriptor. descriptor @see #getObjectType()

Class TypeDescriptor, TypeDescriptor map(Class<?>, TypeDescriptor, TypeDescriptor)

Create a new type descriptor from a java.util.Map type. Useful for Converting to typed Maps. For example, a Map<String, String> could be converted to a Map<Id, EmailAddress> by converting to a targetType built with this method: The method call to construct such a TypeDescriptor would look something like: map(Map.class, TypeDescriptor.valueOf(Id.class), TypeDescriptor.valueOf(EmailAddress.class)); @param mapType the map type, which must implement Map. @param keyTypeDescriptor a descriptor for the map's key type, used to convert map keys @param valueTypeDescriptor the map's value type, used to convert map values @return the map type descriptor
Class TypeDescriptor, TypeDescriptor narrow(Object)

Narrows this TypeDescriptor by setting its type to the class of the provided value. If the value is null, no narrowing is performed and this TypeDescriptor is returned unchanged.

Designed to be called by binding frameworks when they read property, field, or method return values. Allows such frameworks to narrow a TypeDescriptor built from a declared property, field, or method return value type. For example, a field declared as java.lang.Object would be narrowed to java.util.HashMap if it was set to a java.util.HashMap value. The narrowed TypeDescriptor can then be used to convertconvert the HashMap to some other type. Annotation and nested type context is preserved by the narrowed copy. @param value the value to use for narrowing this type descriptor @return this TypeDescriptor narrowed (returns a copy with its type updated to the class of the provided value)

Class TypeDescriptor, TypeDescriptor nested(Field, int)

Creates a type descriptor for a nested type declared within the field.

For example, if the field is a List<String> and the nestingLevel is 1, the nested type descriptor will be String.class. If the field is a List<List<String>> and the nestingLevel is 2, the nested type descriptor will also be a String.class. If the field is a Map<Integer, String> and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value. If the field is a List<Map<Integer, String>> and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value. Returns null if a nested type cannot be obtained because it was not declared. For example, if the field is a List<?>, the nested type descriptor returned will be null. @param field the field @param nestingLevel the nesting level of the collection/array element or map key/value declaration within the field. field @return the nested type descriptor at the specified nestingLevel, or null if it could not be obtained @throws IllegalArgumentException if the types up to the specified nesting level are not of collection, array, or map types.

Class TypeDescriptor, TypeDescriptor nested(MethodParameter, int)

Creates a type descriptor for a nested type declared within the method parameter. For example, if the methodParameter is a List<String> and the nestingLevel is 1, the nested type descriptor will be String.class. If the methodParameter is a List> and the nestingLevel is 2, the nested type descriptor will also be a String.class. If the methodParameter is a Map and the nesting level is 1, the nested type descriptor will be String, derived from the map value. If the methodParameter is a List> and the nesting level is 2, the nested type descriptor will be String, derived from the map value. Returns null if a nested type cannot be obtained because it was not declared. For example, if the method parameter is a List<?>, the nested type descriptor returned will be null. @param methodParameter the method parameter with a nestingLevel of 1 @param nestingLevel the nesting level of the collection/array element or map key/value declaration within the method parameter. parameter @return the nested type descriptor at the specified nesting level, or null if it could not be obtained. obtained @throws IllegalArgumentException if the nesting level of the input MethodParameter argument is not 1. 1 @throws IllegalArgumentException if the types up to the specified nesting level are not of collection, array, or map types.
Class TypeDescriptor, TypeDescriptor nested(Property, int)

Creates a type descriptor for a nested type declared within the property.

For example, if the property is a List<String> and the nestingLevel is 1, the nested type descriptor will be String.class. If the property is a List<List<String>> and the nestingLevel is 2, the nested type descriptor will also be a String.class. If the property is a Map<Integer, String> and the nestingLevel is 1, the nested type descriptor will be String, derived from the map value. If the property is a List<Map<Integer, String>> and the nestingLevel is 2, the nested type descriptor will be String, derived from the map value. Returns null if a nested type cannot be obtained because it was not declared. For example, if the property is a List<?>, the nested type descriptor returned will be null. @param property the property @param nestingLevel the nesting level of the collection/array element or map key/value declaration within the property. property @return the nested type descriptor at the specified nestingLevel, or null if it could not be obtained @throws IllegalArgumentException if the types up to the specified nesting level are not of collection, array, or map types.