Package hudson.util
Class ReflectionUtils
- java.lang.Object
-
- org.springframework.util.ReflectionUtils
-
- hudson.util.ReflectionUtils
-
public class ReflectionUtils extends org.springframework.util.ReflectionUtils
Utility code for reflection.- Since:
- 1.351
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReflectionUtils.Parameter
-
Nested classes/interfaces inherited from class org.springframework.util.ReflectionUtils
org.springframework.util.ReflectionUtils.FieldCallback, org.springframework.util.ReflectionUtils.FieldFilter, org.springframework.util.ReflectionUtils.MethodCallback, org.springframework.util.ReflectionUtils.MethodFilter
-
-
Constructor Summary
Constructors Constructor Description ReflectionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<ReflectionUtils.Parameter>
getParameters(Method m)
Returns an object-oriented view of parameters of each type.static Method
getPublicMethodNamed(Class c, String methodName)
Finds a public method of the given name, regardless of its parameter definitions,static Object
getPublicProperty(Object o, String p)
static Object
getVmDefaultValueForPrimitiveType(Class<?> type)
Given the primitive type, returns the VM default value for that type in a boxed form.-
Methods inherited from class org.springframework.util.ReflectionUtils
accessibleConstructor, clearCache, declaresException, doWithFields, doWithFields, doWithLocalFields, doWithLocalMethods, doWithMethods, doWithMethods, findField, findField, findMethod, findMethod, getAllDeclaredMethods, getDeclaredMethods, getField, getUniqueDeclaredMethods, getUniqueDeclaredMethods, handleInvocationTargetException, handleReflectionException, invokeMethod, invokeMethod, isCglibRenamedMethod, isEqualsMethod, isHashCodeMethod, isObjectMethod, isPublicStaticFinal, isToStringMethod, makeAccessible, makeAccessible, makeAccessible, rethrowException, rethrowRuntimeException, setField, shallowCopyFieldState
-
-
-
-
Method Detail
-
getPublicMethodNamed
public static Method getPublicMethodNamed(Class c, String methodName)
Finds a public method of the given name, regardless of its parameter definitions,
-
getParameters
public static List<ReflectionUtils.Parameter> getParameters(Method m)
Returns an object-oriented view of parameters of each type.
-
getPublicProperty
public static Object getPublicProperty(Object o, String p) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
-
getVmDefaultValueForPrimitiveType
@CheckForNull public static Object getVmDefaultValueForPrimitiveType(Class<?> type)
Given the primitive type, returns the VM default value for that type in a boxed form.- Returns:
- null unless
Class.isPrimitive()
-
-