javadoc polishing
This commit is contained in:
parent
9216b3e8e1
commit
3d318ea387
|
|
@ -89,8 +89,8 @@ public class ConversionExecutionException extends ConversionException {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String defaultMessage(Object value, Class<?> sourceClass, Class<?> targetClass, Throwable cause) {
|
private static String defaultMessage(Object value, Class<?> sourceClass, Class<?> targetClass, Throwable cause) {
|
||||||
return "Unable to convert value " + StylerUtils.style(value) + " from type '" + sourceClass.getName()
|
return "Unable to convert value " + StylerUtils.style(value) + " from type [" + sourceClass.getName()
|
||||||
+ "' to type '" + targetClass.getName() + "'; reason = '" + cause.getMessage() + "'";
|
+ "] to type [" + targetClass.getName() + "]; reason = '" + cause.getMessage() + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -18,9 +18,9 @@ package org.springframework.core.convert.converter;
|
||||||
import org.springframework.util.NumberUtils;
|
import org.springframework.util.NumberUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Converts from any JDK-standard Number implementation to any other JDK-standard Number implementation.
|
* Converts from any JDK-standard Number implementation to any other JDK-standard Number implementation.
|
||||||
*
|
*
|
||||||
* Support Number classes include byte, short, integer, float, double, long, big integer, big decimal. This class
|
* Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class
|
||||||
* delegates to {@link NumberUtils#convertNumberToTargetClass(Number, Class)} to perform the conversion.
|
* delegates to {@link NumberUtils#convertNumberToTargetClass(Number, Class)} to perform the conversion.
|
||||||
*
|
*
|
||||||
* @see java.lang.Byte
|
* @see java.lang.Byte
|
||||||
|
|
@ -31,6 +31,7 @@ import org.springframework.util.NumberUtils;
|
||||||
* @see java.lang.Float
|
* @see java.lang.Float
|
||||||
* @see java.lang.Double
|
* @see java.lang.Double
|
||||||
* @see java.math.BigDecimal
|
* @see java.math.BigDecimal
|
||||||
|
* @see NumberUtils
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ package org.springframework.core.convert.converter;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to a BigDecimal and back.
|
* Converts a String to a BigDecimal using {@link BigDecimal#BigDecimal(String).
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ package org.springframework.core.convert.converter;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to a BigInteger and back.
|
* Converts a String to a BigInteger using {@link BigInteger#BigInteger(String)}.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts String to a Boolean and back.
|
* Converts String to a Boolean. The trueString and falseStrings are configurable.
|
||||||
*
|
*
|
||||||
|
* @see #StringToBoolean(String, String)
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
public class StringToBoolean implements Converter<String, Boolean> {
|
public class StringToBoolean implements Converter<String, Boolean> {
|
||||||
|
|
@ -31,7 +32,7 @@ public class StringToBoolean implements Converter<String, Boolean> {
|
||||||
private String falseString;
|
private String falseString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a StringToBoolean converter.
|
* Create a StringToBoolean converter with the default 'true' and 'false' strings.
|
||||||
*/
|
*/
|
||||||
public StringToBoolean() {
|
public StringToBoolean() {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to a Double and back.
|
* Converts a String to a Double using {@link Double#valueOf(String)}.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts from a String to Enum and back.
|
* Converts from a String to Enum using {@link Enum#valueOf(Class, String)}.
|
||||||
*
|
*
|
||||||
* @author Scott Andrews
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class StringToEnum implements SuperConverter<String, Enum> {
|
public class StringToEnum implements SuperConverter<String, Enum> {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to an Short using {@link Short#valueOf(String)}.
|
* Converts a String to Float using {@link Float#valueOf(String)}.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to an Long using {@link Long#valueOf(String)}.
|
* Converts a String to a Long using {@link Long#valueOf(String)}.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
package org.springframework.core.convert.converter;
|
package org.springframework.core.convert.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a String to an Short using {@link Short#valueOf(String)}.
|
* Converts a String to a Short using {@link Short#valueOf(String)}.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import org.springframework.core.convert.ConversionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A super converter converts a source object of type S to a target type of type AT and back, where AT is equal to or a
|
* A super converter converts a source object of type S to a target type of type AT and back, where AT is equal to or a
|
||||||
* subclass of T.
|
* subclass of T, T being the "super" target type. This allows a single converter to convert to objects that are part of a common class hierarchy.
|
||||||
* <p>
|
* <p>
|
||||||
* Implementations of this interface are thread-safe and can be shared. Converters are typically registered with and
|
* Implementations of this interface are thread-safe and can be shared. Converters are typically registered with and
|
||||||
* accessed through a {@link ConversionService}.
|
* accessed through a {@link ConversionService}.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue