Class TimeFormatter

  • All Implemented Interfaces:
    IFormatter

    public class TimeFormatter
    extends java.lang.Object
    implements IFormatter
    Time formatter with multilocale support.

    Author:
    Chungyen Tsai
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeFormatter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(javax.servlet.http.HttpServletRequest request, java.lang.Object time)
      From a object return a String to render in HTML.
      java.lang.Object parse​(javax.servlet.http.HttpServletRequest request, java.lang.String string)
      From a String obtained from a HTTP request return a java object.
      protected java.lang.String reformatTime​(java.lang.String string)  
      protected java.lang.String reformatTime​(java.lang.String string, boolean parsing)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeFormatter

        public TimeFormatter()
    • Method Detail

      • format

        public java.lang.String format​(javax.servlet.http.HttpServletRequest request,
                                       java.lang.Object time)
        Description copied from interface: IFormatter
        From a object return a String to render in HTML.
        Specified by:
        format in interface IFormatter
      • parse

        public java.lang.Object parse​(javax.servlet.http.HttpServletRequest request,
                                      java.lang.String string)
                               throws java.text.ParseException
        Description copied from interface: IFormatter
        From a String obtained from a HTTP request return a java object.
        Specified by:
        parse in interface IFormatter
        Throws:
        java.text.ParseException
      • reformatTime

        protected java.lang.String reformatTime​(java.lang.String string)
      • reformatTime

        protected java.lang.String reformatTime​(java.lang.String string,
                                                boolean parsing)