DATACMNS-400 - PersistentProperty now exposes findAnnotation(…).

Pulled up the method declaration from AnnotationBasedProperty as it's useful to be able to inspect a property for annotations being configured on it independently from whether the persistent mapping of it has been defined via annotations or not.

Expose isAnnotationPresent(…) as well to ease quick checks for an annotation.
This commit is contained in:
Oliver Gierke
2013-11-13 16:48:44 +00:00
parent 22223f4386
commit fed61720b0
3 changed files with 34 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Map;
@@ -326,6 +327,16 @@ public class AbstractPersistentPropertyUnitTests {
protected Association<SamplePersistentProperty> createAssociation() {
return null;
}
@Override
public <A extends Annotation> A findAnnotation(Class<A> annotationType) {
return null;
}
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
return false;
}
}
static class Sample {