is Constant Annotation Int Field - Java java.lang.annotation

Java examples for java.lang.annotation:Field Annotation

Description

is Constant Annotation Int Field

Demo Code


//package com.java2s;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class Main {

    public static boolean isConstantAnnotationIntField(Field field) {
        final int modifiers = field.getModifiers();
        return Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)
                && Modifier.isStatic(modifiers)
                && field.getType().equals(Integer.TYPE);
    }/*w  ww.j  av a2s  . co m*/
}

Related Tutorials