Load, Parse & Resolve configurations from a resource, with default parse & resolve options.

@param parseOptions
@param resolveOptions
@param classLoader
@param configResource
@return
435340
public static Config loadConfig(ConfigParseOptions parseOptions,
            ConfigResolveOptions resolveOptions, ClassLoader classLoader, String configResource) {
        return ConfigFactory.parseResources(classLoader, configResource, parseOptions)
                .resolve(resolveOptions);
    }
817781
public ConfigurationBuilder addClassLoaders(Collection<ClassLoader> classLoaders) {
        return addClassLoaders(classLoaders.toArray(new ClassLoader[classLoaders.size()]));
    }
412195
public static Predicate parse(final String predicate, ClassLoader classLoader) {
        return PredicateParser.parse(predicate, classLoader);
    }
1078997
private ClassLoader doResolve(Set<? extends File> classPath) {
        List<URL> urls = new ArrayList<URL>(classPath.size());
        for (File file : classPath) {
            try {
                urls.add(file.toURI().toURL());
            } catch (MalformedURLException exception) {
                throw new GradleException("Cannot resolve " + file + " as URL", exception);
            }
        }
        return new URLClassLoader(urls.toArray(new URL[0]), ByteBuddy.class.getClassLoader());
    }
769839
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
    {
        Class c= findLoadedClass(name);
        ClassNotFoundException ex= null;
        boolean tried_parent= false;
        if (c == null && (_java2compliant || isSystemPath(name)) && !isServerPath(name) && _parent!=null)
        {
            if (log.isTraceEnabled())
                log.trace("try loadClass " + name + " from " + _parent);
            tried_parent= true;
            try
            {
                c= _parent.loadClass(name);
                if (log.isTraceEnabled())
                    log.trace("p0 loaded " + c);
            }
            catch (ClassNotFoundException e)
            {
                ex= e;
            }
        }

        if (c == null)
        {
            if (log.isTraceEnabled())
                log.trace("try findClass " + name + " from " + _urlClassPath);
            try
            {
                c= this.findClass(name);
                if (log.isTraceEnabled())
                    log.trace("cx loaded " + c);
            }
            catch (ClassNotFoundException e)
            {
                ex= e;
            }
        }

        if (c == null && !tried_parent && !isServerPath(name) && _parent!=null)
        {
            if (log.isTraceEnabled())
                log.trace("try loadClass " + name + " from " + _parent);
            c= _parent.loadClass(name);
            if (log.isTraceEnabled())
                log.trace("p1 loaded " + c);
        }
        
        if (c == null)
            throw ex;

        if (resolve)
            resolveClass(c);

        return c;
    }
930982
public static SPIProviderResolver getInstance(ClassLoader cl)
   {
      SPIProviderResolver resolver = (SPIProviderResolver)ServiceLoader.loadService(SPIProviderResolver.class.getName(), DEFAULT_SPI_PROVIDER_RESOLVER, cl);
      return resolver;
   }
1094589
private void loadOptions(final P6LoadableOptions options) {
		// make sure to load defaults first
		options.load(options.getDefaults());

		// load the rest in the right order then
		for (P6OptionsSource optionsSource : optionsSources) {
			Map<String, String> toLoad = optionsSource.getOptions();
			if (null != toLoad) {
				options.load(toLoad);
			}
		}

		// register to all the props then
		allOptions.put(options.getClass(), options);
	}
1219461
@Override
  protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException,
      ClassNotFoundException {
    return Class.forName(desc.getName(), true, loader);
  }
626712
public static ArrayList<ConfigSource> getDefaultSources(ClassLoader classloader) {
        ArrayList<ConfigSource> sources = new ArrayList<>();

        sources.add(new SystemConfigSource());
        sources.add(new EnvConfigSource());

        sources.addAll(getPropertiesFileConfigSources(classloader));

        return sources;
    }
117301
public <T> T loadResources(Class<T> type, List<String> resources) {
    if (resources == null || resources.isEmpty()) {
      throw new IllegalArgumentException("resources must be defined");
    }
    Config config = null;
    for (String resource : resources) {
      if (config == null) {
        config = ConfigFactory.load(classLoader, resource);
      } else {
        config = config.withFallback(ConfigFactory.load(classLoader, resource));
      }
    }
    return map(checkNotNull(config, "config cannot be null").resolve(), type);
  }
1169077
function(namespace, ressource, args, options) {
            var d = Q.defer();
            var namespace_configs = _.extend({}, Resources.namespaces[namespace] || {}, options || {});
            var loader = namespace_configs.loader || namespace;
            
            if (Resources.loaders[loader] == null) {
                logging.error("Loader doesn't exists ", loader, "namespace=",namespace);
                d.reject();
                return d.promise;
            }
            Resources.loaders[loader](ressource, d, args, namespace_configs);
            return d.promise;
        }
832837
protected Object resolveProviderConfig(String exp, Map<String, ? extends Object> contextMap, LaContainer container,
            Class<?> resultType) {
        if (exp.startsWith(PROVIDER_GET) && exp.endsWith(METHOD_MARK) && exp.contains(".") && !exp.contains("\"")) {
            final String[] tokens = exp.split("\\.");
            if (tokens.length > 1) {
                Object component = null;
                BeanDesc beanDesc = null;
                for (String prop : tokens) {
                    if (prop.endsWith(METHOD_MARK)) { // method
                        if (component == null) { // e.g. getJdbcUrl() only
                            break;
                        }
                        final String methodName = prop.substring(0, prop.length() - METHOD_MARK.length());
                        component = beanDesc.invoke(component, methodName, (Object[]) null);
                        beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                    } else { // component or property
                        if (beanDesc == null) { // first element
                            if (container.hasComponentDef(prop)) { // component
                                component = container.getComponent(prop);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        } else { // next elements, property
                            final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(prop);
                            if (propertyDesc != null) {
                                component = propertyDesc.getValue(component);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        }
                    }
                }
                if (component != null) {
                    return component;
                }
            }
        }
        return null;
    }
791966
public static <T> T load(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader classLoader,
      PriorityAccessor<T> priorityAccessor) {
    return ServiceProviders.load(klass, hardcoded, classLoader, priorityAccessor);
  }
728767
public function configureOptionsResolver(OptionsResolver $resolver)
    {
        parent::configureOptionsResolver($resolver);
        $resolver->setRequired(self::OPTION_BASE_PATH);
        $resolver->setAllowedTypes(self::OPTION_BASE_PATH, ['string']);
        $resolver->setRequired(self::OPTION_FILENAME);
        $resolver->setAllowedTypes(self::OPTION_FILENAME, ['string']);
        $resolver->setRequired(self::OPTION_TYPE);
        $resolver->setAllowedTypes(self::OPTION_TYPE, ['string']);
        $resolver->setAllowedValues(self::OPTION_TYPE, [self::OPTION_TYPE_VALUE_BODY, self::OPTION_TYPE_VALUE_HEADERS]);
    }
724680
public static Config load(final ClassLoader loader) {
        return ConfigImpl.computeCachedConfig(loader, "load", new Callable<Config>() {
            @Override
            public Config call() {
                return loadDefaultConfig(loader);
            }
        });
    }
506584
public function configureOptions(OptionsResolver $resolver)
    {
        $that = $this;

        if (!interface_exists(ChoiceLoaderInterface::class)) {
            $resolver->setDefaults([
                'context' => null,
                'category' => null,
                'choice_list' => static function (Options $opts, $previousValue) use ($that) {
                    return new SimpleChoiceList($that->getChoices($opts));
                },
            ]);

            return;
        }
        $resolver->setDefaults([
            'context' => null,
            'category' => null,
            'choice_loader' => static function (Options $opts, $previousValue) use ($that) {
                return new CategoryChoiceLoader(array_flip($that->getChoices($opts)));
            },
        ]);
    }
946042
private ClassLoader resolve(Set<? extends File> classPath) {
        ClassLoader classLoader = classLoaders.get(classPath);
        if (classLoader == null) {
            classLoader = doResolve(classPath);
            classLoaders.put(classPath, classLoader);
        }
        return classLoader;
    }