public boolean isTextValid(String text){
  if (text == null) {
    return false;
  }
  text=text.trim();
  if (text.isEmpty()) {
    return settings.getAllowEmptyTimes();
  }
  LocalTime parsedTime=InternalUtilities.getParsedTimeOrNull(text,settings.getFormatForDisplayTime(),settings.getFormatForMenuTimes(),settings.formatsForParsing,settings.getLocale());
  if (parsedTime == null) {
    return false;
  }
  TimeVetoPolicy vetoPolicy=settings.getVetoPolicy();
  if (InternalUtilities.isTimeVetoed(vetoPolicy,parsedTime)) {
    return false;
  }
  return true;
}

public boolean isTextValid ( String text ) { if ( text == null ) { return false ; } text = text . trim ( ) ; if ( text . isEmpty ( ) ) { return settings . getAllowEmptyTimes ( ) ; } LocalTime parsedTime = InternalUtilities . getParsedTimeOrNull ( text , settings . getFormatForDisplayTime ( ) , settings . getFormatForMenuTimes ( ) , settings . formatsForParsing , settings . getLocale ( ) ) ; if ( parsedTime == null ) { return false ; } TimeVetoPolicy vetoPolicy = settings . getVetoPolicy ( ) ; if ( InternalUtilities . isTimeVetoed ( vetoPolicy , parsedTime ) ) { return false ; } return true ; }
istextvalid , this function can be used to see if the supplied text represents a " valid time " according to the settings of this time picker . more specifically , this returns true if : 1 ) the text contains a parsable time that exists , and that has not been vetoed by a current veto policy , or 2 ) ( allowemptytimes = = true ) and text . trim ( ) contains an empty string . otherwise returns false .
