private static boolean isValidDateTime ( String lex ) { try { DateUtility . parseDateStrict ( lex ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Validated dateTime: " + lex ) ; } return true ; } catch ( ParseException e ) { logger . warn ( "Not a valid dateTime: " + lex ) ; return false ; } }
Tells whether the given string is a valid lexical representation of a dateTime value . Passing this test will ensure successful indexing later .