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

      Constructors 
      Constructor Description
      ExtraFieldUtils()  
    • 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

        @CheckForNull
        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 AccessibleObject.setAccessible(boolean) invocation.
        Parameters:
        cls - the class to reflect, must not be null
        fieldName - the field name to obtain
        Returns:
        the Field object, it might be null
        Throws:
        IllegalArgumentException - if the class or field name is null