|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.binding.format.support.AbstractFormatter
org.springframework.binding.format.support.DateFormatter
public class DateFormatter
Formatter that formats date objects.
| Constructor Summary | |
|---|---|
DateFormatter(java.text.DateFormat dateFormat)
Constructs a date formatter that will delegate to the specified date format. |
|
DateFormatter(java.text.DateFormat dateFormat,
boolean allowEmpty)
Constructs a date formatter that will delegate to the specified date format. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
doFormatValue(java.lang.Object date)
Template method subclasses should override to encapsulate formatting logic. |
protected java.lang.Object |
doParseValue(java.lang.String formattedString,
java.lang.Class targetClass)
Template method subclasses should override to encapsulate parsing logic. |
java.util.Date |
parseDate(java.lang.String formattedString)
Convenience method to parse a date. |
| Methods inherited from class org.springframework.binding.format.support.AbstractFormatter |
|---|
formatValue, getEmptyFormattedValue, getEmptyValue, getExpectedFormat, isAllowEmpty, isEmpty, parseValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateFormatter(java.text.DateFormat dateFormat)
dateFormat - the date format to use
public DateFormatter(java.text.DateFormat dateFormat,
boolean allowEmpty)
dateFormat - the date format to useallowEmpty - should this formatter allow empty input arguments?| Method Detail |
|---|
protected java.lang.String doFormatValue(java.lang.Object date)
AbstractFormatter
doFormatValue in class AbstractFormatterdate - the value to format
protected java.lang.Object doParseValue(java.lang.String formattedString,
java.lang.Class targetClass)
throws java.text.ParseException
AbstractFormatter
doParseValue in class AbstractFormatterformattedString - the formatted string to parse
java.text.ParseException - when parse exceptions occur
public java.util.Date parseDate(java.lang.String formattedString)
throws InvalidFormatException
InvalidFormatException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||