Get the corresponding mapper Class, or create it on first call

@param type
to be map
19285
public <T> JsonReaderI<T> getMapper(Class<T> type) {
		// look for cached Mapper
		@SuppressWarnings("unchecked")
		JsonReaderI<T> map = (JsonReaderI<T>) cache.get(type);
		if (map != null)
			return map;
		/*
		 * Special handle
		 */
		if (type instanceof Class) {
			if (Map.class.isAssignableFrom(type))
				map = new DefaultMapperCollection<T>(this, type);
			else if (List.class.isAssignableFrom(type))
				map = new DefaultMapperCollection<T>(this, type);
			if (map != null) {
				cache.put(type, map);
				return map;
			}
		}

		if (type.isArray())
			map = new ArraysMapper.GenericMapper<T>(this, type);
		else if (List.class.isAssignableFrom(type))
			map = new CollectionMapper.ListClass<T>(this, type);
		else if (Map.class.isAssignableFrom(type))
			map = new CollectionMapper.MapClass<T>(this, type);
		else
			// use bean class
			map = new BeansMapper.Bean<T>(this, type);
		cache.putIfAbsent(type, map);
		return map;
	}
1169785
public List<MethodParameter> getParametersOfType(Class<?> type) {

		Assert.notNull(type, "Type must not be null!");

		return getParameters().stream() //
				.filter(it -> it.getParameterType().equals(type)) //
				.collect(Collectors.toList());
	}
177970
public static Class<?> getClassFromType(final Type type) {
        Class<?> returnClass = null;
        if (type instanceof Class<?>) {
            returnClass = (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            returnClass = getClassFromType(((ParameterizedType) type).getRawType());
        }
        return returnClass;
    }
763306
@SuppressWarnings({ "unchecked", "rawtypes" })
    protected Class<S> resolveClass(Type type) {

        Map<TypeVariable, Type> map = new HashMap<TypeVariable, Type>();
        map.putAll(getTypeVariableMap());

        return (Class<S>) ResolvableType.forType(type, new TypeVariableMapVariableResolver(map)).resolve(Object.class);
    }
331218
@SuppressWarnings("unchecked")
  public Class<? extends Mapper<?,?,?,?>> getMapperClass() 
     throws ClassNotFoundException {
    return (Class<? extends Mapper<?,?,?,?>>) 
      conf.getClass(MAP_CLASS_ATTR, Mapper.class);
  }
1121629
public <T> Map<String, T> findByTypeWithName(Class<T> type) {
        return applicationContext.getBeansOfType(type);
    }
1334381
public <T> List<T> getInstances(Class<T> type) {
		return getInstances(Key.get(type));
	}
1276898
public static Class getTypeClass(Type type)
    {
        Class typeClassClass = null;

        if (type instanceof Class) {
            typeClassClass = (Class) type;
        } else if (type instanceof ParameterizedType) {
            typeClassClass = (Class) ((ParameterizedType) type).getRawType();
        } else if (type instanceof GenericArrayType) {
            Class<?> arrrayParameter = getTypeClass(((GenericArrayType) type).getGenericComponentType());
            if (arrrayParameter != null) {
                typeClassClass = Array.newInstance(arrrayParameter, 0).getClass();
            }
        }

        return typeClassClass;
    }
201691
public ClassNode buildMapType(ClassNode keyType, ClassNode valueType) {
        return parameterizedType(ClassHelper.MAP_TYPE, keyType, valueType);
    }
809445
public static <K, V, M extends Map<K, V>> JavaType createMapType(Class<M> m, Class<K> k,
                                                                     Class<V> v) {
        BaseType mapType = new BaseType();
        BaseType keyType = new BaseType();
        BaseType valueType = new BaseType();
        keyType.setType(k);
        valueType.setType(v);
        JavaType[] generics = { keyType, valueType };
        mapType.setType(m);
        mapType.setGenerics(generics);
        return mapType;
    }
449307
public static <E, M extends BinderMapper<E>> M mapperFor(ParameterizedType type) throws NoSuchMapperException {
		@SuppressWarnings("unchecked")
		M mapper = AbstractContext.getMapper((Class<E>) type.getActualTypeArguments()[0]);
		if (mapper == null) {
			throw new NoSuchMapperException(type.getRawType());
		} else {
			return mapper;
		}
	}
274620
private JavaType toJavaType(Type type) {
		JavaType typeToFind;
    	if (type instanceof JavaType) {
    		typeToFind = (JavaType) type;
    	} else {
    		typeToFind = _mapper.constructType(type);
    	}
		return typeToFind;
	}
901620
public static @CheckForNull <T> T lookup(Class<T> type) {
        Jenkins j = Jenkins.getInstanceOrNull();
        return j != null ? j.lookup.get(type) : null;
    }
603957
private Object lookUp(Class<?> type) {
        Jenkins j = Jenkins.getInstance();
        assert j != null : "This method is only invoked after the Jenkins singleton instance has been set";
        if (type==Jenkins.class || type==Hudson.class)
            return j;
        Injector i = j.getInjector();
        if (i!=null)
            return i.getInstance(type);
        throw new IllegalArgumentException("Unable to inject "+type);
    }
576452
private Mapper createMapper(ParameterizedType type) {
    Type rawType = type.getRawType();
    if (!(rawType instanceof Class)) {
      // Don't see how this could ever happen, but just in case...
      throw new IllegalArgumentException(
          String.format("Raw type of ParameterizedType is not a class: %s", type));
    }
    Class<?> rawClass = (Class<?>) rawType;
    Mapper mapper;
    if (Map.class.isAssignableFrom(rawClass)) {
      mapper = new MapMapper(type);
    } else {
      throw new NoSuitableMapperException(String.format("Unsupported type: %s", type));
    }
    return mapper;
  }
1154818
public static <T> TypeReference<T> get(Class<T> type) {
		return new SimpleTypeReference<T>(type);
	}
655401
@SuppressWarnings("unchecked")
  public <S, D> TypeMap<S, D> getOrCreate(S source, Class<S> sourceType, Class<D> destinationType,
      String typeMapName, PropertyMap<S, D> propertyMap, Converter<S, D> converter,
      MappingEngineImpl engine) {
    synchronized (lock) {
      TypePair<S, D> typePair = TypePair.of(sourceType, destinationType, typeMapName);
      TypeMapImpl<S, D> typeMap = (TypeMapImpl<S, D>) typeMaps.get(typePair);

      if (typeMap == null) {
        typeMap = new TypeMapImpl<S, D>(sourceType, destinationType, typeMapName, config, engine);
        if (propertyMap != null)
          typeMap.addMappings(propertyMap);
        if (converter == null && config.isImplicitMappingEnabled()
            && Types.mightContainsProperties(typeMap.getSourceType())
            && Types.mightContainsProperties(typeMap.getDestinationType()))
          ImplicitMappingBuilder.build(source, typeMap, config.typeMapStore, config.converterStore);

        if (typeMap.isFullMatching()) {
          typeMaps.put(typePair, typeMap);
        }
      } else if (propertyMap != null) {
        typeMap.addMappings(propertyMap);
      }

      if (converter != null)
        typeMap.setConverter(converter);
      return typeMap;
    }
  }