Class ExecutableHelper
- java.lang.Object
-
- org.hibernate.validator.internal.util.ExecutableHelper
-
public final class ExecutableHelper extends Object
Provides shared functionality dealing with executables.- Author:
- Hardy Ferentschik, Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
-
-
Constructor Summary
Constructors Constructor Description ExecutableHelper(TypeResolutionHelper typeResolutionHelper)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ElementTypegetElementType(Executable executable)static StringgetExecutableAsString(String name, Class<?>... parameterTypes)Returns a string representation of an executable with the given name and parameter types in the form<name>(<parameterType 0> ... <parameterType n>), e.g.static SignaturegetSignature(Executable executable)static SignaturegetSignature(String name, Class<?>[] parameterTypes)static StringgetSimpleName(Executable executable)booleanisResolvedToSameMethodInHierarchy(Class<?> mainSubType, Method left, Method right)Checks if a pair of given methods (leftandright) are resolved to the same method based on themainSubTypetype.booleanoverrides(Method subTypeMethod, Method superTypeMethod)Checks, whethersubTypeMethodoverridessuperTypeMethod.booleanoverrides(Callable subTypeMethod, Callable superTypeMethod)
-
-
-
Constructor Detail
-
ExecutableHelper
public ExecutableHelper(TypeResolutionHelper typeResolutionHelper)
-
-
Method Detail
-
overrides
public boolean overrides(Method subTypeMethod, Method superTypeMethod)
Checks, whethersubTypeMethodoverridessuperTypeMethod.- Parameters:
subTypeMethod- The sub type method (cannot benull).superTypeMethod- The super type method (cannot benull).- Returns:
- Returns
trueifsubTypeMethodoverridessuperTypeMethod,falseotherwise.
-
isResolvedToSameMethodInHierarchy
public boolean isResolvedToSameMethodInHierarchy(Class<?> mainSubType, Method left, Method right)
Checks if a pair of given methods (leftandright) are resolved to the same method based on themainSubTypetype.- Parameters:
mainSubType- a type at the bottom of class hierarchy to be used to lookup the methods.left- one of the methods to checkright- another of the methods to check- Returns:
trueif a pair of methods are equalleft == right, or one of the methods override another one in the class hierarchy withmainSubTypeat the bottom,falseotherwise.
-
getSimpleName
public static String getSimpleName(Executable executable)
-
getSignature
public static Signature getSignature(Executable executable)
-
getExecutableAsString
public static String getExecutableAsString(String name, Class<?>... parameterTypes)
Returns a string representation of an executable with the given name and parameter types in the form<name>(<parameterType 0> ... <parameterType n>), e.g. for logging purposes.- Parameters:
name- the name of the executableparameterTypes- the types of the executable's parameters- Returns:
- A string representation of the given executable.
-
getElementType
public static ElementType getElementType(Executable executable)
-
-