/** * Method that will add annotations from specified source method to target method, but only if * target does not yet have them. */ protected void _addMixUnders(Method src, AnnotatedMethod target) { for (Annotation a : src.getDeclaredAnnotations()) { if (_annotationIntrospector.isHandled(a)) { target.addIfNotPresent(a); } } }
/** @param addParamAnnotations Whether parameter annotations are to be added as well */ protected void _addMixOvers(Method mixin, AnnotatedMethod target, boolean addParamAnnotations) { for (Annotation a : mixin.getDeclaredAnnotations()) { if (_annotationIntrospector.isHandled(a)) { target.addOrOverride(a); } } if (addParamAnnotations) { Annotation[][] pa = mixin.getParameterAnnotations(); for (int i = 0, len = pa.length; i < len; ++i) { for (Annotation a : pa[i]) { target.addOrOverrideParam(i, a); } } } }
protected AnnotatedMethod _constructCreatorMethod(Method m) { return new AnnotatedMethod( m, _collectRelevantAnnotations(m.getDeclaredAnnotations()), _collectRelevantAnnotations(m.getParameterAnnotations())); }
protected AnnotatedMethod _constructMethod(Method m) { /* note: parameter annotations not used for regular (getter, setter) * methods; only for creator methods (static factory methods) */ return new AnnotatedMethod(m, _collectRelevantAnnotations(m.getDeclaredAnnotations()), null); }