Package org.dellroad.stuff.java
Class MethodAnnotationScanner.MethodInfo
java.lang.Object
org.dellroad.stuff.java.MethodAnnotationScanner.MethodInfo
- Enclosing class:
- MethodAnnotationScanner<T,
A extends Annotation>
Holds information about an annotated method detected by a
MethodAnnotationScanner
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the method annotation.Get the annotated method.Get the Java bean property name implied by the associated method, if any.Assuming this instance's annotated method is a getter method, find the corresponding setter method if it exists.int
hashCode()
Invoke the method and return the result.
-
Constructor Details
-
MethodInfo
-
-
Method Details
-
getMethod
Get the annotated method.- Returns:
- annotated method taking zero parameters and returning non-void
-
getAnnotation
Get the method annotation.- Returns:
- annotation found on the method
-
getMethodPropertyName
Get the Java bean property name implied by the associated method, if any.- Returns:
- the name of the bean property implied by the method
- Throws:
IllegalArgumentException
- if the method does not follow Java bean conventions
-
invoke
Invoke the method and return the result. Any checked exception thrown is rethrown after being wrapped in aRuntimeException
.- Parameters:
obj
- instance on which to invoke the method; may be null for static methodsparams
- method parameters- Returns:
- result of invoking method
- Throws:
RuntimeException
- if invocation fails
-
getSetter
Assuming this instance's annotated method is a getter method, find the corresponding setter method if it exists.- Returns:
- corresponding public setter method, or null if none exists
-
equals
-
hashCode
public int hashCode()
-