Added wiki documentation on API usage from curl. Also fixed a couple bugs, tweaked how rels are generated in some links.

This commit is contained in:
Jon Brisbin
2012-06-13 09:23:58 -05:00
parent e0b3d84362
commit 3e2a79d329
4 changed files with 87 additions and 19 deletions

View File

@@ -107,19 +107,19 @@ public class ValidatingRepositoryEventListener
validate("afterDelete", entity);
}
private Errors validate(String event, Object entity) {
private Errors validate(String event, Object o) {
Errors errors = null;
if (null != entity) {
Class<?> domainType = entity.getClass();
if (null != o) {
Class<?> domainType = o.getClass();
errors = new ValidationErrors(domainType.getSimpleName(),
entity,
o,
repositoryMetadataFor(domainType).entityMetadata());
Collection<Validator> validators = this.validators.get(event);
if (null != validators) {
for (Validator v : validators) {
if (v.supports(entity.getClass())) {
LOG.debug(event + ": " + entity + " with " + v);
ValidationUtils.invokeValidator(v, entity, errors);
if (v.supports(o.getClass())) {
LOG.debug(event + ": " + o + " with " + v);
ValidationUtils.invokeValidator(v, o, errors);
}
}
}