Refine search
/** * Method called to override a method parameter annotation, * usually due to a mix-in * annotation masking or overriding an annotation 'real' method * has. */ public final void addOrOverrideParam(int paramIndex, Annotation a) { AnnotationMap old = _paramAnnotations[paramIndex]; if (old == null) { old = new AnnotationMap(); _paramAnnotations[paramIndex] = old; } old.add(a); }
@Override public final <A extends Annotation> A getAnnotation(Class<A> acls) { if (_annotations == null) { return null; } return _annotations.get(acls); }
@Override @Deprecated public Iterable<Annotation> annotations() { if (_annotations == null) { return Collections.emptyList(); } return _annotations.annotations(); }
protected AnnotationMap _collectRelevantAnnotations(Annotation[] anns) { AnnotationMap annMap = new AnnotationMap(); _addAnnotationsIfNotPresent(annMap, anns); return annMap; }
@Override public AnnotationMap asAnnotationMap() { return new AnnotationMap(); }
private AnnotationMap _addAnnotationsIfNotPresent(AnnotationMap result, Annotation[] anns) { if (anns != null) { List<Annotation> fromBundles = null; for (Annotation ann : anns) { // first: direct annotations // note: we will NOT filter out non-Jackson anns any more boolean wasNotPresent = result.addIfNotPresent(ann); if (wasNotPresent && _isAnnotationBundle(ann)) { fromBundles = _addFromBundle(ann, fromBundles); } } if (fromBundles != null) { // and secondarily handle bundles, if any found: precedence important _addAnnotationsIfNotPresent(result, fromBundles.toArray(new Annotation[fromBundles.size()])); } } return result; }
@Override public <A extends Annotation> A getAnnotation(Class<A> acls) { if (_classAnnotations == null) { resolveClassAnnotations(); } return _classAnnotations.get(acls); }
/** * Method called to override an annotation, usually due to a mix-in * annotation masking or overriding an annotation 'real' constructor * has. */ public final void addOrOverride(Annotation a) { _annotations.add(a); }
private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMember>... nodes) { AnnotationMap ann = _getAllAnnotations(nodes[index]); while (++index < nodes.length) { if (nodes[index] != null) { return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes)); } } return ann; }
/** * Method called to add specified annotation in the Map. * * @return True if the addition changed the contents, that is, this map did not * already have specified annotation */ public boolean add(Annotation ann) { return _add(ann); }
public final int getAnnotationCount() { return _annotations.size(); }
public boolean hasAnnotations() { if (_classAnnotations == null) { resolveClassAnnotations(); } return _classAnnotations.size() > 0; }
private void _addAnnotationsIfNotPresent(AnnotationMap result, Annotation[] anns) { if (anns != null) { List<Annotation[]> bundles = null; for (Annotation ann : anns) { // first: direct annotations if (_isAnnotationBundle(ann)) { if (bundles == null) { bundles = new LinkedList<Annotation[]>(); } bundles.add(ann.annotationType().getDeclaredAnnotations()); } else { // note: we will NOT filter out non-Jackson anns any more result.addIfNotPresent(ann); } } if (bundles != null) { // and secondarily handle bundles, if any found: precedence important for (Annotation[] annotations : bundles) { _addAnnotationsIfNotPresent(result, annotations); } } } }
@Override public Iterable<Annotation> annotations() { if (_classAnnotations == null) { resolveClassAnnotations(); } return _classAnnotations.annotations(); }
/** * Method called to augment annotations, by adding specified * annotation if and only if it is not yet present in the * annotation map we have. */ public final void addIfNotPresent(Annotation a) { _annotations.addIfNotPresent(a); }
protected AnnotationMap _collectRelevantAnnotations(Annotation[] anns) { AnnotationMap annMap = new AnnotationMap(); _addAnnotationsIfNotPresent(annMap, anns); return annMap; }
static AnnotationMap _emptyAnnotationMap() { return new AnnotationMap(); }
private AnnotationMap _addAnnotationsIfNotPresent(AnnotationMap result, Annotation[] anns) { if (anns != null) { List<Annotation> fromBundles = null; for (Annotation ann : anns) { // first: direct annotations // note: we will NOT filter out non-Jackson anns any more boolean wasNotPresent = result.addIfNotPresent(ann); if (wasNotPresent && _isAnnotationBundle(ann)) { fromBundles = _addFromBundle(ann, fromBundles); } } if (fromBundles != null) { // and secondarily handle bundles, if any found: precedence important _addAnnotationsIfNotPresent(result, fromBundles.toArray(new Annotation[fromBundles.size()])); } } return result; }
@Override public <A extends Annotation> A getAnnotation(Class<A> acls) { if (_classAnnotations == null) { resolveClassAnnotations(); } return _classAnnotations.get(acls); }
/** * Method called to override an annotation, usually due to a mix-in * annotation masking or overriding an annotation 'real' constructor * has. */ public final boolean addOrOverride(Annotation a) { return _annotations.add(a); }