public <J, D> Converter<J, D> getConverter(SinglePropertyMetadata<J, D> metadata) {
		Class<J> propertyType = metadata.getPropertyType();
		if (metadata.getAnnotation(AsJSON.class) != null) {
			TypeFactory typeFactory = objectMapper.getTypeFactory();
			JavaType type;
			if (Map.class.isAssignableFrom(propertyType)) {
				Class[] mapKeyValue = guessMapGenericType(metadata);
				type = typeFactory.constructMapType(Map.class, mapKeyValue[0], mapKeyValue[1]);
			} else if (Set.class.isAssignableFrom(propertyType)) {
				type = typeFactory.constructCollectionType(Set.class, typeFactory.constructType(guessCollectionGenericType(metadata)));
			} else if (Collection.class.isAssignableFrom(propertyType)) {
					type = typeFactory.constructCollectionType(List.class, typeFactory.constructType(guessCollectionGenericType(metadata)));
			} else {
				type = typeFactory.uncheckedSimpleType(propertyType);
			}
			return new JsonConverter(type, objectMapper);
		}
		if (Collection.class.isAssignableFrom(propertyType)) {
			return getCollectionConverter((Class<? extends Iterable>) propertyType, guessCollectionGenericType(metadata));
		} else {
			return getConverter(propertyType);
		}

	}
public < J , D > Converter < J , D > getConverter ( SinglePropertyMetadata < J , D > metadata ) { Class < J > propertyType = metadata . getPropertyType ( ) ; if ( metadata . getAnnotation ( AsJSON . class ) != null ) { TypeFactory typeFactory = objectMapper . getTypeFactory ( ) ; JavaType type ; if ( Map . class . isAssignableFrom ( propertyType ) ) { Class [ ] mapKeyValue = guessMapGenericType ( metadata ) ; type = typeFactory . constructMapType ( Map . class , mapKeyValue [ 0 ] , mapKeyValue [ 1 ] ) ; } else if ( Set . class . isAssignableFrom ( propertyType ) ) { type = typeFactory . constructCollectionType ( Set . class , typeFactory . constructType ( guessCollectionGenericType ( metadata ) ) ) ; } else if ( Collection . class . isAssignableFrom ( propertyType ) ) { type = typeFactory . constructCollectionType ( List . class , typeFactory . constructType ( guessCollectionGenericType ( metadata ) ) ) ; } else { type = typeFactory . uncheckedSimpleType ( propertyType ) ; } return new JsonConverter ( type , objectMapper ) ; } if ( Collection . class . isAssignableFrom ( propertyType ) ) { return getCollectionConverter ( ( Class < ? extends Iterable > ) propertyType , guessCollectionGenericType ( metadata ) ) ; } else { return getConverter ( propertyType ) ; } }
@return the converter for a PropertyMetadata instance