public Date parse(String text,String format,Locale locale) throws ParserException {
  SimpleDateFormat dateFormat=getDateFormat(format,locale);
  try {
    return dateFormat.parse(text.trim());
  }
 catch (  ParseException e) {
    throw new ParserException("Error when parsing date(" + dateFormat.toPattern() + ") from "+ text,e);
  }
}

public Date parse ( String text , String format , Locale locale ) throws ParserException { SimpleDateFormat dateFormat = getDateFormat ( format , locale ) ; try { return dateFormat . parse ( text . trim ( ) ) ; } catch ( ParseException e ) { throw new ParserException ( "Error when parsing date(" + dateFormat . toPattern ( ) + ") from " + text , e ) ; } }
parse the text with the format and locale specified
