|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.seaf.util.TemporalConverterUtil
public class TemporalConverterUtil
Utility methods for converting temporal types.
| Constructor Summary | |
|---|---|
TemporalConverterUtil()
|
|
| Method Summary | |
|---|---|
static void |
backwardValidationOfStringValue(String originalValue,
Calendar parsedValue,
String format)
Throw IllegalArgumentException when the parsed Calendar value does not match the original String value, from which it has been parsed. |
static Calendar |
convert(Object o,
String format)
Convert an object to a Calendar. |
static String |
formatDate(Calendar value,
String format)
Format a Calendar value as a String using the given format. |
static Calendar |
parseDate(String text,
String format)
Parse a Calendar from String value using a Java date format pattern. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TemporalConverterUtil()
| Method Detail |
|---|
public static Calendar convert(Object o,
String format)
throws IllegalArgumentException
Calendar.
Passes null unchanged. Passes Calendar
unchanged. Converts Date. Otherwise, parses the passed
object as String using the format supplied.
o - The object to be convertedformat - The Java date format pattern, see DateFormat
Calendar
IllegalArgumentException - Thrown when the supplied object is not a valid temporal value
given the format specified
public static Calendar parseDate(String text,
String format)
throws IllegalArgumentException
text - The String containing temporal value representationformat - The Java date format pattern, see DateFormat
Calendar
IllegalArgumentException - Thrown when the supplied text is not a valid temporal value
given the format specified
public static void backwardValidationOfStringValue(String originalValue,
Calendar parsedValue,
String format)
throws IllegalArgumentException
originalValue - The original String valueparsedValue - The parsed Calendar valueformat - The format used for parsing
IllegalArgumentException - Thrown when the parsed value does not match the original
value
public static String formatDate(Calendar value,
String format)
value - Calendar valueformat - Format to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||