protected < T extends Annotation > T extractPropertyAnnotation ( Method writeMethod , Method readMethod , Class < T > annotationClass ) { T parameterDescription = writeMethod . getAnnotation ( annotationClass ) ; if ( parameterDescription == null && readMethod != null ) { parameterDescription = readMethod . getAnnotation ( annotationClass ) ; } return parameterDescription ; }
Get the parameter annotation . Try first on the setter then on the getter if no annotation has been found .