Class FormatLibrary
java.lang.Object
name.matthewgreet.strutscommons.util.FormatLibrary
Static library functions for formatting data for display but also parsing them for validation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatDateLongYear
(Date value) Returns formatted date in DD/MM/YYYY without time component.static String
formatDateShortTime
(Date value) Returns formatted date and time in DD/MM/YY HH:MM.static String
formatNumber
(Integer value) static Integer
parseInteger
(String value, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String notNumberMessage) static <T extends Enum<T>>
TparseRequiredEnum
(String field, Class<T> enumType, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage, String notEnumMessage) static int
parseRequiredInt
(String field, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage, String notIntMessage) static String
parseRequiredString
(String field, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage)
-
Constructor Details
-
FormatLibrary
public FormatLibrary()
-
-
Method Details
-
formatDateLongYear
Returns formatted date in DD/MM/YYYY without time component. -
formatDateShortTime
Returns formatted date and time in DD/MM/YY HH:MM. -
formatNumber
-
parseRequiredEnum
-
parseInteger
-
parseRequiredInt
-
parseRequiredString
-