protected TypeNameIdResolver(MapperConfig<?> config, JavaType baseType, Map<String, String> typeToId, Map<String, JavaType> idToType) { super(baseType, config.getTypeFactory()); _config = config; _typeToId = typeToId; _idToType = idToType; }
/** * Helper method that will construct {@link JavaType} for given * raw class. * This is a simple short-cut for: *<pre> * getTypeFactory().constructType(cls); *</pre> */ public final JavaType constructType(Class<?> cls) { return getTypeFactory().constructType(cls); }
public ClassIdResolver(final JavaType baseType, final MapperConfig<?> config) { super(baseType, config.getTypeFactory()); }
@Override @Deprecated // since 2.8 public JavaType resolveType(java.lang.reflect.Type jdkType) { if (jdkType == null) { return null; } return _config.getTypeFactory().constructType(jdkType, _type.getBindings()); }
/** * Helper method that will construct {@link JavaType} for given * type reference * This is a simple short-cut for: *<pre> * getTypeFactory().constructType(valueTypeRef); *</pre> */ public final JavaType constructType(TypeReference<?> valueTypeRef) { return getTypeFactory().constructType(valueTypeRef.getType()); }
public JavaType constructSpecializedType(JavaType baseType, Class<?> subclass) { return getTypeFactory().constructSpecializedType(baseType, subclass); }
AnnotatedClass resolveWithoutSuperTypes() { List<JavaType> superTypes = Collections.<JavaType>emptyList(); return new AnnotatedClass(null, _class, superTypes, _primaryMixin, resolveClassAnnotations(superTypes), _bindings, _intr, _config, _config.getTypeFactory()); }
/** * Helper method that will either return configured custom * type id resolver, or construct a standard resolver * given configuration. */ protected TypeIdResolver idResolver(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) { // Custom id resolver? if (_customIdResolver != null) { return _customIdResolver; } if (_idType == null) throw new IllegalStateException("Cannot build, 'init()' not yet called"); switch (_idType) { case CLASS: return new ClassNameIdResolver(baseType, config.getTypeFactory()); case MINIMAL_CLASS: return new MinimalClassNameIdResolver(baseType, config.getTypeFactory()); case NAME: return TypeNameIdResolver.construct(config, baseType, subtypes, forSer, forDeser); case NONE: // hmmh. should never get this far with 'none' return null; case CUSTOM: // need custom resolver... } throw new IllegalStateException("Do not know how to construct standard type id resolver for idType: "+_idType); } }
AnnotatedClass resolveFully() { List<JavaType> superTypes = ClassUtil.findSuperTypes(_type, null, false); return new AnnotatedClass(_type, _class, superTypes, _primaryMixin, resolveClassAnnotations(superTypes), _bindings, _intr, _mixInResolver, _config.getTypeFactory()); }
final TypeFactory tf = config.getTypeFactory();
final TypeFactory tf = config.getTypeFactory();
public JaxbAnnotationIntrospector(MapperConfig<?> config) { this(config.getTypeFactory()); }
final TypeFactory tf = config.getTypeFactory();
final TypeFactory tf = config.getTypeFactory(); if (baseType.getContentType() == null) { // non-container/-structured types, usually scalar:
protected TypeNameIdResolver(MapperConfig<?> config, JavaType baseType, HashMap<String, String> typeToId, HashMap<String, JavaType> idToType) { super(baseType, config.getTypeFactory()); _config = config; _typeToId = typeToId; _idToType = idToType; }
@Override public TypeBindings bindingsForBeanType() { if (_bindings == null) { _bindings = new TypeBindings(_config.getTypeFactory(), _type); } return _bindings; }
@Override protected TypeIdResolver idResolver(MapperConfig<?> config, JavaType baseType, Collection<NamedType> subtypes, boolean forSer, boolean forDeser) { return new AvroTypeIdResolver(baseType, config.getTypeFactory(), subtypes); } }
@Override public TypeBindings bindingsForBeanType() { if (_bindings == null) { _bindings = new TypeBindings(_config.getTypeFactory(), _type); } return _bindings; }
AnnotatedClass resolveFully() { List<JavaType> superTypes = ClassUtil.findSuperTypes(_type, null, false); return new AnnotatedClass(_type, _class, superTypes, _primaryMixin, resolveClassAnnotations(superTypes), _bindings, _intr, _mixInResolver, _config.getTypeFactory()); }
public static AnnotatedClass constructWithoutSuperTypes(Class<?> cls, MapperConfig<?> config, MixInResolver mir) { if (config == null) { return new AnnotatedClass(null, cls, TypeBindings.emptyBindings(), Collections.<JavaType>emptyList(), null, null, null); } AnnotationIntrospector intr = config.isAnnotationProcessingEnabled() ? config.getAnnotationIntrospector() : null; return new AnnotatedClass(null, cls, TypeBindings.emptyBindings(), Collections.<JavaType>emptyList(), intr, mir, config.getTypeFactory()); }