From b9682d7823dd5c5afad990a516b58e44dadee5de Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Mon, 1 Jun 2009 18:49:00 +0000 Subject: [PATCH] forgot to commit --- .../springframework/ui/format/number/DecimalFormatter.java | 4 ++++ .../springframework/ui/format/number/IntegerFormatter.java | 4 ++++ .../springframework/ui/format/number/PercentFormatter.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java index fa41a4145d..c4d41b066c 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/DecimalFormatter.java @@ -40,6 +40,10 @@ public class DecimalFormatter implements Formatter { initDefaults(); } + public Class getFormattedObjectType() { + return BigDecimal.class; + } + public DecimalFormatter(String pattern) { initDefaults(); formatFactory.setPattern(pattern); diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java index 22421b876f..4c7d282aea 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/IntegerFormatter.java @@ -33,6 +33,10 @@ public class IntegerFormatter implements Formatter { private boolean lenient; + public Class getFormattedObjectType() { + return Long.class; + } + public String format(Long integer, Locale locale) { if (integer == null) { return ""; diff --git a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java index c57c4e92a4..94304f5521 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/format/number/PercentFormatter.java @@ -35,6 +35,10 @@ public class PercentFormatter implements Formatter { private boolean lenient; + public Class getFormattedObjectType() { + return BigDecimal.class; + } + public String format(BigDecimal decimal, Locale locale) { if (decimal == null) { return "";