Example usage for java.lang.reflect AccessibleObject getDeclaredAnnotations

List of usage examples for java.lang.reflect AccessibleObject getDeclaredAnnotations

Introduction

In this page you can find the example usage for java.lang.reflect AccessibleObject getDeclaredAnnotations.

Prototype

public Annotation[] getDeclaredAnnotations() 

Source Link

Usage

From source file:com.anrisoftware.globalpom.reflection.annotations.AnnotationDiscoveryImpl.java

private Set<AnnotationBean> findAnnotations(Set<AnnotationBean> result, Object bean,
        List<? extends AccessibleObject> members) {
    for (AccessibleObject member : members) {
        Annotation[] annotations = member.getDeclaredAnnotations();
        findAnnotations(result, member, bean, annotations);
    }/*from  www  . jav a2 s  . co m*/
    return result;
}

From source file:com.yahoo.elide.core.EntityDictionary.java

/**
 * Returns annotations applied to the ID field.
 *
 * @param value the value//from   w  ww  .  ja  v  a2  s .  com
 * @return Collection of Annotations
 */
public Collection<Annotation> getIdAnnotations(Object value) {
    if (value == null) {
        return null;
    }

    AccessibleObject idField = entityBinding(value.getClass()).getIdField();
    if (idField != null) {
        return Arrays.asList(idField.getDeclaredAnnotations());
    }

    return Collections.emptyList();
}