Added xml support for event listener and made minor cleanup

This commit is contained in:
alex-semenyuk
2015-08-15 16:34:42 +02:00
parent 236b808d05
commit 971d62568e
6 changed files with 27 additions and 24 deletions

View File

@@ -0,0 +1,22 @@
package org.baeldung.event;
import java.lang.reflect.Field;
import org.springframework.data.annotation.Id;
import org.springframework.util.ReflectionUtils;
public class FieldCallback implements ReflectionUtils.FieldCallback {
private boolean idFound;
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
ReflectionUtils.makeAccessible(field);
if (field.isAnnotationPresent(Id.class)) {
idFound = true;
}
}
public boolean isIdFound() {
return idFound;
}
}