get Annotations from Object - Android java.lang.reflect

Android examples for java.lang.reflect:Annotation

Description

get Annotations from Object

Demo Code


//package com.java2s;
import java.lang.annotation.Annotation;

public class Main {
    public static void getAnnotations(Object object) {
        Annotation[] annotations = object.getClass().getAnnotations();
        for (Annotation annotation : annotations) {
            //            annotation.
        }/*w  ww .  j  a  va  2  s  .  co  m*/

    }
}

Related Tutorials