Package ca.uhn.fhir.util
Class ReflectionUtil
java.lang.Object
ca.uhn.fhir.util.ReflectionUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdescribeMethodInSortFriendlyWay(Method theMethod)Returns a description likestartsWith params(java.lang.String, int) returns(boolean).getDeclaredMethods(Class<?> theClazz)Returns all methods declared against theClazz.getDeclaredMethods(Class<?> theClazz, boolean theIncludeMethodsFromSuperclasses)Returns all methods declared against theClazz.static Class<?>static Class<?>For a field of type List>, returns Foo static Class<?>getGenericCollectionTypeOfMethodParameter(Method theMethod, int theParamIndex)static Class<?>getGenericCollectionTypeOfMethodReturnType(Method theMethod)static booleanisInstantiable(Class<?> theType)static <T> TnewInstance(Class<T> theType)Instantiate a class by no-arg constructor, throwConfigurationExceptionif we fail to do sostatic <T> TnewInstance(Class<T> theType, Class<?> theArgumentType, Object theArgument)static ObjectnewInstanceOfFhirServerType(String theType)static <T> TnewInstanceOrReturnNull(String theClassName, Class<T> theType)static <T> TnewInstanceOrReturnNull(String theClassName, Class<T> theType, Class<?>[] theArgTypes, Object[] theArgs)static booleantypeExists(String theName)
-
Field Details
-
EMPTY_OBJECT_ARRAY
-
EMPTY_CLASS_ARRAY
-
-
Method Details
-
getDeclaredMethods
Returns all methods declared against theClazz. This method returns a predictable order, which is sorted by method name and then by parameters.This method does not include superclass methods (see
getDeclaredMethods(Class, boolean)if you want to include those. -
getDeclaredMethods
public static List<Method> getDeclaredMethods(Class<?> theClazz, boolean theIncludeMethodsFromSuperclasses)Returns all methods declared against theClazz. This method returns a predictable order, which is sorted by method name and then by parameters. -
describeMethodInSortFriendlyWay
Returns a description likestartsWith params(java.lang.String, int) returns(boolean). The format is chosen in order to provide a predictable and useful sorting order. -
getGenericCollectionTypeOfField
-
getGenericCollectionTypeOfFieldWithSecondOrderForList
For a field of type List>, returns Foo -
getGenericCollectionTypeOfMethodParameter
public static Class<?> getGenericCollectionTypeOfMethodParameter(Method theMethod, int theParamIndex) -
getGenericCollectionTypeOfMethodReturnType
-
isInstantiable
-
newInstance
Instantiate a class by no-arg constructor, throwConfigurationExceptionif we fail to do so -
newInstance
-
newInstanceOfFhirServerType
-
newInstanceOrReturnNull
-
newInstanceOrReturnNull
public static <T> T newInstanceOrReturnNull(String theClassName, Class<T> theType, Class<?>[] theArgTypes, Object[] theArgs) -
typeExists
-