@Test public void testComplexValidation() throws IllegalArgumentException { schema.clearFields(); schema.addField("booleanField", booleanSchema); schema.addField("longField", longSchema); schema.addField("doubleField", doubleSchema); schema.addField("stringField", stringSchema); schema.addField("tokenField", tokenSchema); schema.addField("dateTimeField", dateTimeSchema); tokenSchema.getProperties().clear(); List<String> tokens = new ArrayList<String>(); tokens.add("validToken"); tokenSchema.getProperties().put(TokenSchema.TOKENS, tokens); Map<String, Object> complexEntity = new HashMap<String, Object>(); Boolean booleanEntity = true; Long longEntity = 0L; Double doubleEntity = 0.0; String stringEntity = "test"; String tokenEntity = "validToken"; String dateTimeEntity = "2012-01-01T12:00:00-05:00"; complexEntity.put("booleanField", booleanEntity); complexEntity.put("longField", longEntity); complexEntity.put("doubleField", doubleEntity); complexEntity.put("stringField", stringEntity); complexEntity.put("tokenField", tokenEntity); complexEntity.put("dateTimeField", dateTimeEntity); assertTrue("Complex entity validation failed", schema.validate(complexEntity)); }
@Override protected boolean validate(String validateFieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return this.validate(validateFieldName, entity, errors, repo, true); }
ComplexSchema extends NeutralSchema { @Override protected boolean validate(String validateFieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return this.validate(validateFieldName, entity, errors, repo, true); } }
ComplexSchema extends NeutralSchema { @Override protected boolean validate(String validateFieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return this.validate(validateFieldName, entity, errors, repo, true); } ComplexSchema();  ComplexSchema(String xsdType); }
ComplexSchema extends NeutralSchema { @Override protected boolean validate(String validateFieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return this.validate(validateFieldName, entity, errors, repo, true); } ComplexSchema();  ComplexSchema(String xsdType); @Override boolean isPrimitive(); @Override NeutralSchemaType getSchemaType(); @Override boolean validatePresent(Object entity, List<ValidationError> errors, Repository<Entity> repo); @Override boolean isSimple(); }
ComplexSchema extends NeutralSchema { @Override protected boolean validate(String validateFieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return this.validate(validateFieldName, entity, errors, repo, true); } ComplexSchema();  ComplexSchema(String xsdType); @Override boolean isPrimitive(); @Override NeutralSchemaType getSchemaType(); @Override boolean validatePresent(Object entity, List<ValidationError> errors, Repository<Entity> repo); @Override boolean isSimple();  }