| java.lang.Object org.springframework.beans.factory.support.AutowireUtils
AutowireUtils | abstract class AutowireUtils (Code) | | Utility class that contains various methods useful for
the implementation of autowire-capable bean factories.
author: Juergen Hoeller since: 1.1.2 See Also: AbstractAutowireCapableBeanFactory |
getTypeDifferenceWeight | public static int getTypeDifferenceWeight(Class[] paramTypes, Object[] args)(Code) | | Determine a weight that represents the class hierarchy difference between types and
arguments. A direct match, i.e. type Integer -> arg of class Integer, does not increase
the result - all direct matches means weight 0. A match between type Object and arg of
class Integer would increase the weight by 2, due to the superclass 2 steps up in the
hierarchy (i.e. Object) being the last one that still matches the required type Object.
Type Number and class Integer would increase the weight by 1 accordingly, due to the
superclass 1 step up the hierarchy (i.e. Number) still matching the required type Number.
Therefore, with an arg of type Integer, a constructor (Integer) would be preferred to a
constructor (Number) which would in turn be preferred to a constructor (Object).
All argument weights get accumulated.
Parameters: paramTypes - the parameter types to match Parameters: args - the arguments to match the accumulated weight for all arguments |
isExcludedFromDependencyCheck | public static boolean isExcludedFromDependencyCheck(PropertyDescriptor pd)(Code) | | Determine whether the given bean property is excluded from dependency checks.
This implementation excludes properties defined by CGLIB.
Parameters: pd - the PropertyDescriptor of the bean property whether the bean property is excluded |
isSetterDefinedInInterface | public static boolean isSetterDefinedInInterface(PropertyDescriptor pd, Set interfaces)(Code) | | Return whether the setter method of the given bean property is defined
in any of the given interfaces.
Parameters: pd - the PropertyDescriptor of the bean property Parameters: interfaces - the Set of interfaces (Class objects) whether the setter method is defined by an interface |
sortConstructors | public static void sortConstructors(Constructor[] constructors)(Code) | | Sort the given constructors, preferring public constructors and "greedy" ones
with a maximum of arguments. The result will contain public constructors first,
with decreasing number of arguments, then non-public constructors, again with
decreasing number of arguments.
Parameters: constructors - the constructor array to sort |
|
|