Class ExtraFieldUtils

  • @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public class ExtraFieldUtils
    extends org.apache.commons.lang.reflect.FieldUtils
    Extends FieldUtils by adding some utility methods.
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Field getFieldNoForce​(Class cls, String fieldName)
      Gets an accessible Field by name without breaking scope.
      • Methods inherited from class org.apache.commons.lang.reflect.FieldUtils

        getDeclaredField, getDeclaredField, getField, getField, readDeclaredField, readDeclaredField, readDeclaredStaticField, readDeclaredStaticField, readField, readField, readField, readField, readStaticField, readStaticField, readStaticField, readStaticField, writeDeclaredField, writeDeclaredField, writeDeclaredStaticField, writeDeclaredStaticField, writeField, writeField, writeField, writeField, writeStaticField, writeStaticField, writeStaticField, writeStaticField
    • Constructor Detail

      • ExtraFieldUtils

        public ExtraFieldUtils()
    • Method Detail

      • getFieldNoForce

        public static Field getFieldNoForce​(Class cls,
                                            String fieldName)
        Gets an accessible Field by name without breaking scope. Superclasses/interfaces will be considered. This is an equivalent of FieldUtils.getField(Class, String, boolean) from the commons lang library, but without Field.setAccessible(boolean) invocation.
        cls - the class to reflect, must not be null
        fieldName - the field name to obtain
        the Field object, it might be null
        IllegalArgumentException - if the class or field name is null