Example usage for org.apache.commons.lang3.reflect FieldUtils readStaticField

List of usage examples for org.apache.commons.lang3.reflect FieldUtils readStaticField

Introduction

In this page you can find the example usage for org.apache.commons.lang3.reflect FieldUtils readStaticField.

Prototype

public static Object readStaticField(final Class<?> cls, final String fieldName, final boolean forceAccess)
        throws IllegalAccessException 

Source Link

Document

Reads the named static Field .

Usage

From source file:org.sparkcommerce.openadmin.web.rulebuilder.enums.AbstractRuleBuilderEnumOptionsExtensionListener.java

@SuppressWarnings("unchecked")
protected Map<String, ? extends SparkEnumerationType> getTypes(Class<? extends SparkEnumerationType> clazz) {
    try {// w  ww.j av  a  2  s  . c  o  m
        return (Map<String, ? extends SparkEnumerationType>) FieldUtils.readStaticField(clazz, "TYPES", true);
    } catch (IllegalAccessException e) {
        throw new RuntimeException(e);
    }
}