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 StringformatDateLongYear(Date value) Returns formatted date in DD/MM/YYYY without time component.static StringformatDateShortTime(Date value) Returns formatted date and time in DD/MM/YY HH:MM.static StringformatNumber(Integer value) static IntegerparseInteger(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 intparseRequiredInt(String field, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage, String notIntMessage) static StringparseRequiredString(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
-