@Deprecated // since 2.7 public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
AnnotatedClass resolveFully() { List<JavaType> superTypes = ClassUtil.findSuperTypes(_type, null, false); return new AnnotatedClass(_type, _class, superTypes, _primaryMixin, resolveClassAnnotations(superTypes), _bindings, _intr, _mixInResolver, _config.getTypeFactory()); }
/** * Method that will find all sub-classes and implemented interfaces * of a given class or interface. Classes are listed in order of * precedence, starting with the immediate super-class, followed by * interfaces class directly declares to implemented, and then recursively * followed by parent of super-class and so forth. * Note that <code>Object.class</code> is not included in the list * regardless of whether <code>endBefore</code> argument is defined or not. * * @param endBefore Super-type to NOT include in results, if any; when * encountered, will be ignored (and no super types are checked). */ public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
/** * Method that will find all sub-classes and implemented interfaces * of a given class or interface. Classes are listed in order of * precedence, starting with the immediate super-class, followed by * interfaces class directly declares to implemented, and then recursively * followed by parent of super-class and so forth. * Note that <code>Object.class</code> is not included in the list * regardless of whether <code>endBefore</code> argument is defined or not. * * @param endBefore Super-type to NOT include in results, if any; when * encountered, will be ignored (and no super types are checked). */ public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
/** * Method that will find all sub-classes and implemented interfaces * of a given class or interface. Classes are listed in order of * precedence, starting with the immediate super-class, followed by * interfaces class directly declares to implemented, and then recursively * followed by parent of super-class and so forth. * Note that <code>Object.class</code> is not included in the list * regardless of whether <code>endBefore</code> argument is defined or not. * * @param endBefore Super-type to NOT include in results, if any; when * encountered, will be ignored (and no super types are checked). */ public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
/** * Method that will find all sub-classes and implemented interfaces * of a given class or interface. Classes are listed in order of * precedence, starting with the immediate super-class, followed by * interfaces class directly declares to implemented, and then recursively * followed by parent of super-class and so forth. * Note that <code>Object.class</code> is not included in the list * regardless of whether <code>endBefore</code> argument is defined or not. * * @param endBefore Super-type to NOT include in results, if any; when * encountered, will be ignored (and no super types are checked). */ public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
@Deprecated // since 2.7 public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
@Deprecated // since 2.7 public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore) { return findSuperTypes(cls, endBefore, new ArrayList<Class<?>>(8)); }
/** * Factory method that instantiates an instance. Returned instance * will only be initialized with class annotations, but not with * any method information. */ public static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr, MixInResolver mir) { return new AnnotatedClass(cls, ClassUtil.findSuperTypes(cls, null), aintr, mir, null); }
/** * Factory method that instantiates an instance. Returned instance * will only be initialized with class annotations, but not with * any method information. */ public static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr, MixInResolver mir) { return new AnnotatedClass(cls, ClassUtil.findSuperTypes(cls, null), aintr, mir, null); }
/** * Factory method that instantiates an instance. Returned instance * will only be initialized with class annotations, but not with * any method information. */ public static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr, MixInResolver mir) { return new AnnotatedClass(cls, ClassUtil.findSuperTypes(cls, null), aintr, mir, null); }
/** * Factory method that instantiates an instance. Returned instance * will only be initialized with class annotations, but not with * any method information. */ public static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr, MixInResolver mir) { return new AnnotatedClass(cls, ClassUtil.findSuperTypes(cls, null), aintr, mir, null); }
/** * Method called to add field mix-ins from given mix-in class (and its fields) * into already collected actual fields (from introspected classes and their * super-classes) */ protected void _addFieldMixIns(Class<?> targetClass, Class<?> mixInCls, Map<String,AnnotatedField> fields) { List<Class<?>> parents = new ArrayList<Class<?>>(); parents.add(mixInCls); ClassUtil.findSuperTypes(mixInCls, targetClass, parents); for (Class<?> mixin : parents) { for (Field mixinField : mixin.getDeclaredFields()) { // there are some dummy things (static, synthetic); better ignore if (!_isIncludableField(mixinField)) { continue; } String name = mixinField.getName(); // anything to mask? (if not, quietly ignore) AnnotatedField maskedField = fields.get(name); if (maskedField != null) { _addOrOverrideAnnotations(maskedField, mixinField.getDeclaredAnnotations()); } } } }
protected void _addClassMixIns(AnnotationMap annotations, Class<?> toMask, Class<?> mixin) { if (mixin == null) { return; } // Ok, first: annotations from mix-in class itself: _addAnnotationsIfNotPresent(annotations, mixin.getDeclaredAnnotations()); /* 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.findSuperTypes(mixin, toMask)) { _addAnnotationsIfNotPresent(annotations, parent.getDeclaredAnnotations()); } }
protected void _addClassMixIns(AnnotationMap annotations, Class<?> toMask, Class<?> mixin) { if (mixin == null) { return; } // Ok, first: annotations from mix-in class itself: _addAnnotationsIfNotPresent(annotations, mixin.getDeclaredAnnotations()); /* 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.findSuperTypes(mixin, toMask)) { _addAnnotationsIfNotPresent(annotations, parent.getDeclaredAnnotations()); } }
protected void _addClassMixIns(AnnotationMap annotations, Class<?> toMask, Class<?> mixin) { if (mixin == null) { return; } // Ok, first: annotations from mix-in class itself: _addAnnotationsIfNotPresent(annotations, mixin.getDeclaredAnnotations()); /* 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.findSuperTypes(mixin, toMask)) { _addAnnotationsIfNotPresent(annotations, parent.getDeclaredAnnotations()); } }
protected void _addClassMixIns(AnnotationMap annotations, Class<?> toMask, Class<?> mixin) { if (mixin == null) { return; } // Ok, first: annotations from mix-in class itself: _addAnnotationsIfNotPresent(annotations, mixin.getDeclaredAnnotations()); /* 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.findSuperTypes(mixin, toMask)) { _addAnnotationsIfNotPresent(annotations, parent.getDeclaredAnnotations()); } }
AnnotatedClass resolveFully() { List<JavaType> superTypes = ClassUtil.findSuperTypes(_type, null, false); return new AnnotatedClass(_type, _class, superTypes, _primaryMixin, resolveClassAnnotations(superTypes), _bindings, _intr, _mixInResolver, _config.getTypeFactory()); }
/** * @since 2.7 */ public static AnnotatedClass construct(JavaType type, MapperConfig<?> config, MixInResolver mir) { AnnotationIntrospector intr = config.isAnnotationProcessingEnabled() ? config.getAnnotationIntrospector() : null; Class<?> raw = type.getRawClass(); return new AnnotatedClass(type, raw, type.getBindings(), ClassUtil.findSuperTypes(type, null, false), intr, mir, config.getTypeFactory()); }
/** * Factory method that instantiates an instance. Returned instance * will only be initialized with class annotations, but not with * any method information. * * @since 2.7 */ public static AnnotatedClass construct(JavaType type, MapperConfig<?> config) { AnnotationIntrospector intr = config.isAnnotationProcessingEnabled() ? config.getAnnotationIntrospector() : null; Class<?> raw = type.getRawClass(); return new AnnotatedClass(type, raw, type.getBindings(), ClassUtil.findSuperTypes(type, null, false), intr, (MixInResolver) config, config.getTypeFactory()); }