@Override public Converter create(BeanProperty property, Genson genson) { if (property.getRawClass().isAssignableFrom(IdRef.class)) { return IdRefConverters.idRefConverter; } if (property.getRawClass().isAssignableFrom(LazyJson.class)) { return LazyJsonConverters.get(property.getName(), property.getType()); } return null; } }
Converter<?> provide(BeanProperty property, Genson genson) { Type type = property.getType(); for (Iterator<? extends ContextualFactory<?>> it = contextualFactories.iterator(); it .hasNext(); ) { ContextualFactory<?> factory = it.next(); Converter<?> object = null; Type factoryType = lookupGenericType(ContextualFactory.class, factory.getClass()); factoryType = expandType(factoryType, factory.getClass()); Type factoryParameter = typeOf(0, factoryType); if (type instanceof Class<?> && ((Class<?>) type).isPrimitive()) type = wrap((Class<?>) type); if (match(type, factoryParameter, false) && (object = factory.create(property, genson)) != null) { return object; } } return null; } }
Converter<?> provide(BeanProperty property, Genson genson) { Type type = property.getType(); for (Iterator<? extends ContextualFactory<?>> it = contextualFactories.iterator(); it .hasNext(); ) { ContextualFactory<?> factory = it.next(); Converter<?> object = null; Type factoryType = lookupGenericType(ContextualFactory.class, factory.getClass()); factoryType = expandType(factoryType, factory.getClass()); Type factoryParameter = typeOf(0, factoryType); if (type instanceof Class<?> && ((Class<?>) type).isPrimitive()) type = wrap((Class<?>) type); if (match(type, factoryParameter, false) && (object = factory.create(property, genson)) != null) { return object; } } return null; } }
Type adaptedType = typeOf(0, adapterExpandedType); Type originalType = typeOf(1, adapterExpandedType); Type propertyType = property.getType();
Type adaptedType = typeOf(0, adapterExpandedType); Type originalType = typeOf(1, adapterExpandedType); Type propertyType = property.getType();