使用额外的资源加载器加载模板
@param key
@param loader
@return
322566
public Template getTemplate(String key, ResourceLoader loader)
	{
		return this.getTemplateByLoader(key, loader,true);
	}
149078
public MapOptions<K, V> loader(MapLoader<K, V> loader) {
        this.loader = loader;
        return this;
    }
352032
public JsonReaderI<?> startObject(String key) throws ParseException, IOException {
		Object bean = mapper.getValue(obj, key);
		if (bean == null)
			return mapper.startObject(key);
		return new UpdaterMapper<Object>(base, bean, mapper.getType(key));
	}
1031937
public static <T, K, S, X extends Collection<T>> X loadNToOne(X list,
			Function<T, K> keyGetter,
			Function<Collection<K>, Collection<S>> loader,
			Function<S, K> loadedKeyGetter, BiConsumer<T, S> match) {
		if (list == null || list.size() == 0)
			return list;

		Set<K> keys = toSet(list, keyGetter);
		if (keys == null || keys.size() == 0)
			return list;

		Collection<S> subs = loader.apply(keys);
		if (subs == null || subs.size() == 0)
			return list;

		HashMap<K, S> map = toHashMap(subs, loadedKeyGetter);
		for (T item : list) {
			K key = keyGetter.apply(item);
			if (key == null)
				continue;

			S sub = map.get(key);
			if (sub == null)
				continue;
			match.accept(item, sub);
		}

		return list;
	}
1223616
function Loader(options) {
  if (!(this instanceof Loader)) {
    return new Loader(options);
  }
  this.options = options || {};
  this.cache = this.options.helpers || {};
}
296571
public final UserManagedCacheBuilder<K, V, T> withClassLoader(ClassLoader classLoader) {
    if (classLoader == null) {
      throw new NullPointerException("Null classloader");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.classLoader = classLoader;
    return otherBuilder;
  }
230681
public static Class<?> define(ClassLoader loader) {

        try {
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                String packageName = DriverManagerAccessor.class.getPackage().getName();
                RuntimePermission permission = new RuntimePermission("defineClassInPackage." + packageName);
                sm.checkPermission(permission);
            }

            byte[] b = loadBytes();
            Object[] args = new Object[]{DriverManagerAccessor.class.getName().replace('/', '.'), b, new Integer(0), new Integer(b.length)};
            Class<?> clazz = (Class<?>) defineClass.invoke(loader, args);
            return clazz;
        } catch (RuntimeException e) {
            //we have to attempt to define the class first
            //otherwise it may be returned by a different class loader
            try {
                return loader.loadClass(DriverManagerAccessor.class.getName());
            } catch (ClassNotFoundException ex) {
                //ignore
            }
            throw e;
        } catch (Exception e) {
            try {
                return loader.loadClass(DriverManagerAccessor.class.getName());
            } catch (ClassNotFoundException ex) {
                //ignore
            }
            throw new RuntimeException(e);
        }
    }
99549
public static InjectorImpl create(ClassLoader loader)
  {
    synchronized (loader) {
      if (loader instanceof DynamicClassLoader) {
        InjectorImpl inject = _localManager.getLevel(loader);

        if (inject == null) {
          inject = (InjectorImpl) InjectorAmp.manager(loader).get();
          _localManager.set(inject, loader);
        }

        return inject;
      }
      else {
        SoftReference<InjectorImpl> injectRef = _loaderManagerMap.get(loader);

        InjectorImpl inject = null;

        if (injectRef != null) {
          inject = injectRef.get();

          if (inject != null) {
            return inject;
          }
        }

        inject = (InjectorImpl) InjectorAmp.manager(loader).get();

        _loaderManagerMap.put(loader, new SoftReference<>(inject));

        return inject;
      }
    }
  }
1005322
private static Constructor<?> createImpl(Class<?> cl,
                                           ClassLoader loader)
  {
    /**
    if (! Modifier.isAbstract(cl.getModifiers())) {
      throw new IllegalArgumentException();
    }
    */
    
    ClassGeneratorVault<?> generator
      = new ClassGeneratorVault<>(cl, loader);
    
    Class<?> proxyClass = generator.generate();
    
    return proxyClass.getConstructors()[0];
  }
79065
public <T extends Object> T load(Class<T> clazz, Object hashKey, DynamoDBMapperConfig config) {
        return load(clazz, hashKey, null, config);
    }
951740
public <T extends StoreConfigurationBuilder<?, ?>> T addStore(Class<T> klass) {
      try {
         Constructor<T> constructor = klass.getDeclaredConstructor(PersistenceConfigurationBuilder.class);
         T builder = constructor.newInstance(this);
         this.stores.add(builder);
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate loader configuration builder '" + klass.getName()
               + "'", e);
      }
   }
672359
public T load(H hashKey) {
        return mapper.<T>load(model.targetType(), hashKey);
    }
1115625
public function getLoaderDefinition($key)
    {
        if (array_key_exists($key, $this->loader)) {
            return $this->loader[$key];
        }

        return null;
    }
976076
@SuppressWarnings("unchecked")
    public static <T> Class<T> loadClass(String className, ClassLoader loader) {
        Assert.notNull(className, "className不能为null");
        Assert.notNull(loader, "loader不能为null");
        switch (className) {
            case "boolean":
                return (Class<T>) boolean.class;
            case "byte":
                return (Class<T>) byte.class;
            case "char":
                return (Class<T>) char.class;
            case "short":
                return (Class<T>) short.class;
            case "int":
                return (Class<T>) int.class;
            case "long":
                return (Class<T>) long.class;
            case "double":
                return (Class<T>) double.class;
            case "float":
                return (Class<T>) float.class;
            default:
                try {
                    return (Class<T>) loader.loadClass(className);
                } catch (ClassNotFoundException e) {
                    throw new ReflectException("找不到指定class：" + className, e);
                }
        }
    }
633455
public Map<String, List<Object>> batchLoad(Map<Class<?>, List<KeyPair>> itemsToGet) {
        return batchLoad(itemsToGet, this.config);
    }
1221913
@SuppressWarnings("unchecked")
    private CompletionStage<List<V>> invokeMapBatchLoader(List<K> keys, BatchLoaderEnvironment environment) {
        CompletionStage<Map<K, V>> loadResult;
        Set<K> setOfKeys = new LinkedHashSet<>(keys);
        if (batchLoadFunction instanceof MappedBatchLoaderWithContext) {
            loadResult = ((MappedBatchLoaderWithContext<K, V>) batchLoadFunction).load(setOfKeys, environment);
        } else {
            loadResult = ((MappedBatchLoader<K, V>) batchLoadFunction).load(setOfKeys);
        }
        CompletionStage<Map<K, V>> mapBatchLoad = nonNull(loadResult, "Your batch loader function MUST return a non null CompletionStage promise");
        return mapBatchLoad.thenApply(map -> {
            List<V> values = new ArrayList<>();
            for (K key : keys) {
                V value = map.get(key);
                values.add(value);
            }
            return values;
        });
    }
1254374
function loadService(info, key, service) {

    const item = parseService(info, key, service);

    const target = loader.app.serviceClasses;

    // item { properties: [ 'a', 'b', 'c'], exports }
    // => target.a.b.c = exports
    item.properties.reduce((target, property, index) => {
      let obj;
      const properties = item.properties.slice(0, index + 1).join('.');
      if (index === item.properties.length - 1) {
        if (property in target) {
          if (!loader.options.override) throw new Error(`can't overwrite property '${properties}' from ${target[property][loader.FileLoader.FULLPATH]} by ${item.pathName}`);
        }
        obj = item.exports;
        if (obj && !is.primitive(obj)) {
          obj[loader.FileLoader.FULLPATH] = item.pathName;
          obj[loader.FileLoader.EXPORTS] = true;
        }
      } else {
        obj = target[property] || {};
      }
      target[property] = obj;
      return obj;
    }, target);

    return item;
  }