예제 #1
0
 /** Does the parse-work without the mandatory-check */
 private String parse2(String external) throws FmtParseException {
   // trim blanks on both sides
   if (external == null) return "";
   external = external.trim();
   if (external.length() == 0) return "";
   else {
     ParsePosition pp = new ParsePosition(0);
     Date date = null;
     date = dateFormat_.parse(external, pp);
     if (date == null || (pp.getIndex() != external.length() && pp.getIndex() > 0)) {
       throw new FmtParseException("ATSSyntax", getSampleTS());
     }
     return TimeStampUtil.date2Internal(date);
   }
 }
예제 #2
0
 /** @see at.spardat.enterprise.fmt.IFmt#isLegalInternal(String) */
 public boolean isLegalInternal(String internal) {
   return TimeStampUtil.internal2Date(internal) != null;
 }
예제 #3
0
 /** @see at.spardat.enterprise.fmt.IFmt#format(String) */
 public String format(String internal) {
   if (internal == null || internal.length() == 0) return "";
   return dateFormat_.format(TimeStampUtil.internal2Date(internal));
 }