private NamedType resolveAutoValue(NamedType namedType) { final Class<?> cls = namedType.getType(); if (cls.getSimpleName().startsWith("AutoValue_")) { return new NamedType(cls.getSuperclass(), namedType.getName()); } else { return namedType; } } }
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
/** * Method called to find subtypes for a specific type (class), using * type id as the unique key (in case of conflicts). */ protected void _collectAndResolveByTypeId(AnnotatedClass annotatedType, NamedType namedType, MapperConfig<?> config, Set<Class<?>> typesHandled, Map<String,NamedType> byName) { final AnnotationIntrospector ai = config.getAnnotationIntrospector(); if (!namedType.hasName()) { String name = ai.findTypeName(annotatedType); if (name != null) { namedType = new NamedType(namedType.getType(), name); } } if (namedType.hasName()) { byName.put(namedType.getName(), namedType); } // only check subtypes if this type hadn't yet been handled if (typesHandled.add(namedType.getType())) { Collection<NamedType> st = ai.findSubtypes(annotatedType); if (st != null && !st.isEmpty()) { for (NamedType subtype : st) { AnnotatedClass subtypeClass = AnnotatedClassResolver.resolveWithoutSuperTypes(config, subtype.getType()); _collectAndResolveByTypeId(subtypeClass, subtype, config, typesHandled, byName); } } } }
public AvroTypeIdResolver(JavaType baseType, TypeFactory typeFactory, Collection<NamedType> subTypes) { this(baseType, typeFactory); if (subTypes != null) { for (NamedType namedType : subTypes) { registerSubtype(namedType.getType(), namedType.getName()); } } }
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
String id = t.hasName() ? t.getName() : _defaultTypeId(cls); if (forSer) { typeToId.put(cls.getName(), id);
/** * Method called to find subtypes for a specific type (class), using * type id as the unique key (in case of conflicts). */ protected void _collectAndResolveByTypeId(AnnotatedClass annotatedType, NamedType namedType, MapperConfig<?> config, Set<Class<?>> typesHandled, Map<String,NamedType> byName) { final AnnotationIntrospector ai = config.getAnnotationIntrospector(); if (!namedType.hasName()) { String name = ai.findTypeName(annotatedType); if (name != null) { namedType = new NamedType(namedType.getType(), name); } } if (namedType.hasName()) { byName.put(namedType.getName(), namedType); } // only check subtypes if this type hadn't yet been handled if (typesHandled.add(namedType.getType())) { Collection<NamedType> st = ai.findSubtypes(annotatedType); if (st != null && !st.isEmpty()) { for (NamedType subtype : st) { AnnotatedClass subtypeClass = AnnotatedClass.constructWithoutSuperTypes(subtype.getType(), config); _collectAndResolveByTypeId(subtypeClass, subtype, config, typesHandled, byName); } } } }
/** * Method called to find subtypes for a specific type (class), using * type id as the unique key (in case of conflicts). */ protected void _collectAndResolveByTypeId(AnnotatedClass annotatedType, NamedType namedType, MapperConfig<?> config, Set<Class<?>> typesHandled, Map<String,NamedType> byName) { final AnnotationIntrospector ai = config.getAnnotationIntrospector(); if (!namedType.hasName()) { String name = ai.findTypeName(annotatedType); if (name != null) { namedType = new NamedType(namedType.getType(), name); } } if (namedType.hasName()) { byName.put(namedType.getName(), namedType); } // only check subtypes if this type hadn't yet been handled if (typesHandled.add(namedType.getType())) { Collection<NamedType> st = ai.findSubtypes(annotatedType); if (st != null && !st.isEmpty()) { for (NamedType subtype : st) { AnnotatedClass subtypeClass = AnnotatedClassResolver.resolveWithoutSuperTypes(config, subtype.getType()); _collectAndResolveByTypeId(subtypeClass, subtype, config, typesHandled, byName); } } } }