/** * @since 2.9 */ protected AnnotatedClass _resolveAnnotatedClass(MapperConfig<?> config, JavaType type, MixInResolver r) { return AnnotatedClassResolver.resolve(config, type, r); }
public static AnnotatedClass resolveWithoutSuperTypes(MapperConfig<?> config, Class<?> forType, MixInResolver r) { if (forType.isArray() && skippableArray(config, forType)) { return createArrayType(config, forType); } return new AnnotatedClassResolver(config, forType, r).resolveWithoutSuperTypes(); }
resolvedCA = _addClassMixIns(resolvedCA, _class, _primaryMixin); resolvedCA = _addAnnotationsIfNotPresent(resolvedCA, ClassUtil.findClassAnnotations(_class)); resolvedCA = _addClassMixIns(resolvedCA, cls, _mixInResolver.findMixInClassFor(cls)); resolvedCA = _addAnnotationsIfNotPresent(resolvedCA, ClassUtil.findClassAnnotations(type.getRawClass())); resolvedCA = _addClassMixIns(resolvedCA, Object.class, _mixInResolver.findMixInClassFor(Object.class));
public static AnnotatedClass resolve(MapperConfig<?> config, JavaType forType, MixInResolver r) { if (forType.isArrayType() && skippableArray(config, forType.getRawClass())) { return createArrayType(config, forType.getRawClass()); } return new AnnotatedClassResolver(config, forType, r).resolveFully(); }
private AnnotationCollector _addAnnotationsIfNotPresent(AnnotationCollector c, Annotation[] anns) { if (anns != null) { for (Annotation ann : anns) { // first: direct annotations // note: we will NOT filter out non-Jackson annotations any more if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = _addFromBundleIfNotPresent(c, ann); } } } } return c; }
private AnnotationCollector _addClassMixIns(AnnotationCollector annotations, Class<?> target, Class<?> mixin) { if (mixin != null) { // Ok, first: annotations from mix-in class itself: annotations = _addAnnotationsIfNotPresent(annotations, ClassUtil.findClassAnnotations(mixin)); // And then from its supertypes, if any. But note that we will only consider // super-types up until reaching the masked class (if found); this because // often mix-in class is a sub-class (for convenience reasons). // And if so, we absolutely must NOT include super types of masked class, // as that would inverse precedence of annotations. for (Class<?> parent : ClassUtil.findSuperClasses(mixin, target, false)) { annotations = _addAnnotationsIfNotPresent(annotations, ClassUtil.findClassAnnotations(parent)); } } return annotations; }
public static AnnotatedClass resolve(MapperConfig<?> config, JavaType forType, MixInResolver r) { if (forType.isArrayType() && skippableArray(config, forType.getRawClass())) { return createArrayType(config, forType.getRawClass()); } return new AnnotatedClassResolver(config, forType, r).resolveFully(); }
private AnnotationCollector _addFromBundleIfNotPresent(AnnotationCollector c, Annotation bundle) { for (Annotation ann : ClassUtil.findClassAnnotations(bundle.annotationType())) { // minor optimization: by-pass 2 common JDK meta-annotations if ((ann instanceof Target) || (ann instanceof Retention)) { continue; } if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = _addFromBundleIfNotPresent(c, ann); } } } return c; } }
private AnnotationCollector _addClassMixIns(AnnotationCollector annotations, Class<?> target, Class<?> mixin) { if (mixin != null) { // Ok, first: annotations from mix-in class itself: annotations = _addAnnotationsIfNotPresent(annotations, ClassUtil.findClassAnnotations(mixin)); // And then from its supertypes, if any. But note that we will only consider // super-types up until reaching the masked class (if found); this because // often mix-in class is a sub-class (for convenience reasons). // And if so, we absolutely must NOT include super types of masked class, // as that would inverse precedence of annotations. for (Class<?> parent : ClassUtil.findSuperClasses(mixin, target, false)) { annotations = _addAnnotationsIfNotPresent(annotations, ClassUtil.findClassAnnotations(parent)); } } return annotations; }
/** * @deprecated Since 2.9, use methods in {@link AnnotatedClassResolver} instead. */ @Deprecated public static AnnotatedClass construct(JavaType type, MapperConfig<?> config, MixInResolver mir) { return AnnotatedClassResolver.resolve(config, type, mir); }
public static AnnotatedClass resolveWithoutSuperTypes(MapperConfig<?> config, JavaType forType, MixInResolver r) { if (forType.isArrayType() && skippableArray(config, forType.getRawClass())) { return createArrayType(config, forType.getRawClass()); } return new AnnotatedClassResolver(config, forType, r).resolveWithoutSuperTypes(); }
resolvedCA = _addClassMixIns(resolvedCA, _class, _primaryMixin); resolvedCA = _addAnnotationsIfNotPresent(resolvedCA, ClassUtil.findClassAnnotations(_class)); resolvedCA = _addClassMixIns(resolvedCA, cls, _mixInResolver.findMixInClassFor(cls)); resolvedCA = _addAnnotationsIfNotPresent(resolvedCA, ClassUtil.findClassAnnotations(type.getRawClass())); resolvedCA = _addClassMixIns(resolvedCA, Object.class, _mixInResolver.findMixInClassFor(Object.class));
private AnnotationCollector _addAnnotationsIfNotPresent(AnnotationCollector c, Annotation[] anns) { if (anns != null) { for (Annotation ann : anns) { // first: direct annotations // note: we will NOT filter out non-Jackson annotations any more if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = _addFromBundleIfNotPresent(c, ann); } } } } return c; }
ac = AnnotatedClassResolver.resolve(config, config.constructType(ZoneId.class), config);
public static AnnotatedClass resolveWithoutSuperTypes(MapperConfig<?> config, Class<?> forType, MixInResolver r) { if (forType.isArray() && skippableArray(config, forType)) { return createArrayType(config, forType); } return new AnnotatedClassResolver(config, forType, r).resolveWithoutSuperTypes(); }
private AnnotationCollector _addFromBundleIfNotPresent(AnnotationCollector c, Annotation bundle) { for (Annotation ann : ClassUtil.findClassAnnotations(bundle.annotationType())) { // minor optimization: by-pass 2 common JDK meta-annotations if ((ann instanceof Target) || (ann instanceof Retention)) { continue; } if (!c.isPresent(ann)) { c = c.addOrOverride(ann); if (_intr.isAnnotationBundle(ann)) { c = _addFromBundleIfNotPresent(c, ann); } } } return c; } }
ac = AnnotatedClassResolver.resolve(config, config.constructType(ZoneId.class), config);
public static AnnotatedClass resolveWithoutSuperTypes(MapperConfig<?> config, JavaType forType, MixInResolver r) { if (forType.isArrayType() && skippableArray(config, forType.getRawClass())) { return createArrayType(config, forType.getRawClass()); } return new AnnotatedClassResolver(config, forType, r).resolveWithoutSuperTypes(); }
/** * Return the Jackson AnnotatedClass for the given bean type. */ Object obtain() { ObjectMapper objectMapper = (ObjectMapper) serverConfig.getObjectMapper(); JavaType javaType = objectMapper.getTypeFactory().constructType(beanType); return AnnotatedClassResolver.resolve(objectMapper.getDeserializationConfig(), javaType, objectMapper.getDeserializationConfig()); } }
/** * @since 2.9 */ protected AnnotatedClass _resolveAnnotatedClass(MapperConfig<?> config, JavaType type, MixInResolver r) { return AnnotatedClassResolver.resolve(config, type, r); }