@Test public void testInputConversionPerFieldSchema() { schema.clearFields(); schema.addField("booleanField", booleanSchema); schema.addField("longField", longSchema); schema.addField("doubleField", doubleSchema); schema.addField("stringField", stringSchema); schema.addField("tokenField", tokenSchema); 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>(); String booleanEntity = "true"; String longEntity = "0"; String doubleEntity = "0.0"; String stringEntity = "test"; String tokenEntity = "validToken"; complexEntity.put("booleanField", booleanEntity); complexEntity.put("longField", longEntity); complexEntity.put("doubleField", doubleEntity); complexEntity.put("stringField", stringEntity); complexEntity.put("tokenField", tokenEntity); assertTrue("Complex entity validation failed", schema.validate(complexEntity)); assertTrue("Failed to properly convert boolean input", complexEntity.get("booleanField") instanceof Boolean); assertTrue("Failed to properly convert boolean input", complexEntity.get("longField") instanceof Long); assertTrue("Failed to properly convert boolean input", complexEntity.get("doubleField") instanceof Double); assertTrue("Failed to properly convert boolean input", complexEntity.get("stringField") instanceof String); assertTrue("Failed to properly convert boolean input", complexEntity.get("tokenField") instanceof String); }
@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();  }