@Test public void testDateTimeValidation() { Calendar calendar = Calendar.getInstance(); String dateTimeString = javax.xml.bind.DatatypeConverter.printTime(calendar); assertTrue("DateTime entity validation failed", schema.validate(dateTimeString)); }
protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); }
DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); } }
DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); } DateTimeSchema();  DateTimeSchema(String xsdType); }
DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); } DateTimeSchema();  DateTimeSchema(String xsdType); @Override NeutralSchemaType getSchemaType(); @Override Object convert(Object value); }
DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, entity, "RFC 3339 DateTime", ErrorType.INVALID_DATE_FORMAT, errors); } DateTimeSchema();  DateTimeSchema(String xsdType); @Override NeutralSchemaType getSchemaType(); @Override Object convert(Object value);  }