public static Object getStaticFieldVal ( final Class < ? > cls , final String fieldName , final boolean throwException ) throws IllegalArgumentException { if ( cls == null || fieldName == null ) { if ( throwException ) { throw new NullPointerException ( ) ; } else { return null ; } } return getFieldVal ( cls , null , fieldName , throwException ) ; }
Get the value of the named static field in the given class or any of its superclasses . If an exception is thrown while trying to read the field value and throwException is true then IllegalArgumentException is thrown wrapping the cause otherwise this will return null . If passed a null class reference returns null unless throwException is true then throws IllegalArgumentException .