Class ExtraFieldUtils

java.lang.Object
org.apache.commons.lang.reflect.FieldUtils
io.jenkins.plugins.casc.util.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
     
  • Method Summary

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExtraFieldUtils

      public ExtraFieldUtils()
  • Method Details

    • 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 Field.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