Class FormatLibrary

java.lang.Object
name.matthewgreet.strutscommons.util.FormatLibrary

public class FormatLibrary extends Object
Static library functions for formatting data for display but also parsing them for validation.
  • Constructor Details

    • FormatLibrary

      public FormatLibrary()
  • Method Details

    • formatDateLongYear

      public static String formatDateLongYear(Date value)
      Returns formatted date in DD/MM/YYYY without time component.
    • formatDateShortTime

      public static String formatDateShortTime(Date value)
      Returns formatted date and time in DD/MM/YY HH:MM.
    • formatNumber

      public static String formatNumber(Integer value)
    • parseRequiredEnum

      public static <T extends Enum<T>> T parseRequiredEnum(String field, Class<T> enumType, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage, String notEnumMessage)
    • parseInteger

      public static Integer parseInteger(String value, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String notNumberMessage)
    • parseRequiredInt

      public static int parseRequiredInt(String field, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage, String notIntMessage)
    • parseRequiredString

      public static String parseRequiredString(String field, com.opensymphony.xwork2.interceptor.ValidationAware validationAware, String requiredMessage)