Initializes Resolver to find files by mimicking the default template
resolver and using compiler extensions.
772445
protected function initializeResolver()
    {
        $extensions = $this->getCompiler()->getExtensions();
        $resolver = $this->resolver = new AggregateResolver();
    
        $stack = array($this->getView()->resolver());
        while ($source = array_shift($stack)) {
            if ($source instanceof AggregateResolver) {
                foreach ($source as $child) {
                    array_push($stack, $child);
                }
            } elseif ($source instanceof TemplatePathStack) {
                foreach ($extensions as $extension) {
                    $child = clone $source;
                    $child->setDefaultSuffix($extension);
                    $resolver->attach($child);
                }
            } else {
                $resolver->attach($source);
            }
        }
    }
574465
private void initializeConfigPropertiesFiles(ClassLoader cl, String fileName) {
        final String methodName = "initializeConfigPropertiesFiles()";

        if (tc.isEntryEnabled())
            Tr.entry(tc, methodName + " classLoader=" + cl + " fileName=" + fileName);
        try {
            Enumeration<URL> resources = cl.getResources(fileName);
            while (resources.hasMoreElements()) {
                URL url = resources.nextElement();
                if (!processedUrls.contains(url))
                    processConfigUrl(url);
            }
        } catch (Exception ex) {
        }
        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName);
    }
704784
private boolean findFiles(String[] args, String option, Set<String> suffixes,
                              Map<String,Source> found_files, Map<String, Module> found_modules,
                              Module current_module, boolean inLinksrc)
        throws ProblemException, ProblemException
    {
        // Track which source roots, source path roots and class path roots have been added.
        Set<File> roots = new HashSet<File>();
        // Track the current set of package includes,excludes as well as excluded source files,
        // to be used in the next -src/-sourcepath/-classpath
        List<String> includes = new LinkedList<String>();
        List<String> excludes = new LinkedList<String>();
        List<String> excludefiles = new LinkedList<String>();
        List<String> includefiles = new LinkedList<String>();
        // This include is used to find all modules in the source.
        List<String> moduleinfo = new LinkedList<String>();
        moduleinfo.add("module-info.java");

        for (int i = 0; i<args.length; ++i) {
            if (args[i].equals("-i")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a package pattern following -i");
                }
                String incl = args[i+1];
                checkPattern(incl);
                includes.add(incl);
            }
            if (args[i].equals("-x")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a package pattern following -x");
                }
                String excl = args[i+1];
                checkPattern(excl);
                excludes.add(excl);
            }
            if (args[i].equals("-xf")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a file following -xf");
                }
                String exclf = args[i+1];
                checkFilePattern(exclf);
                exclf = Util.normalizeDriveLetter(exclf);
                excludefiles.add(fixupSeparator(exclf));
            }
            if (args[i].equals("-if")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a file following -xf");
                }
                String inclf = args[i+1];
                checkFilePattern(inclf);
                inclf = Util.normalizeDriveLetter(inclf);
                includefiles.add(fixupSeparator(inclf));
            }
            if (args[i].equals(option)) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a directory following "+option);
                }
                String[] root_dirs = args[i+1].split(File.pathSeparator);
                for (String r : root_dirs) {
                    File root = new File(r);
                    if (!root.isDirectory()) {
                        throw new ProblemException("\""+r+"\" is not a directory.");
                    }
                    try {
                        root = root.getCanonicalFile();
                    } catch (IOException e) {
                        throw new ProblemException(""+e);
                    }
                    if (roots.contains(root)) {
                        throw new ProblemException("\""+r+"\" has already been used for "+option);
                    }
                    if (root.equals(bin_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -d");
                    }
                    if (root.equals(gensrc_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -s");
                    }
                    if (root.equals(header_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -h");
                    }
                    roots.add(root);
                    Source.scanRoot(root, suffixes, excludes, includes, excludefiles, includefiles,
                                    found_files, found_modules, current_module,
                                    findBooleanOption(args, "--permit-sources-without-package"),
                                    false, inLinksrc);
                }
            }
            if (args[i].equals("-src") ||
                args[i].equals("-sourcepath") ||
                args[i].equals("-modulepath") ||
                args[i].equals("-classpath") ||
                args[i].equals("-cp"))
            {
                // Reset the includes,excludes and excludefiles after they have been used.
                includes = new LinkedList<String>();
                excludes = new LinkedList<String>();
                excludefiles = new LinkedList<String>();
                includefiles = new LinkedList<String>();
            }
        }
        return true;
    }
846689
private function resolveHelpers()
    {

        if (count($helpers = Arr::get($this->getGeneral(), 'helpers', []))) {

            foreach ($helpers as $helper) {
                if (file_exists($helper)) {
                    include $helper;
                }
            }

        }

    }
943563
def determine_resolver(params)
      if params[:resolver]
        Djatoka::Resolver.new(params[:resolver])
      elsif Djatoka.resolver
        Djatoka.resolver
      else
        nil
      end
    end
1051446
public ClassLoader resolve(Iterable<? extends File> classPath) {
        Set<File> classPathList = new LinkedHashSet<File>();
        for (File file : classPath) {
            classPathList.add(file);
        }
        return resolve(classPathList);
    }
371819
@Override
    public void initialize() {
        this.fileAlterationObserver = new FileAlterationObserver(directory, fileFilter);
        this.fileAlterationObserver.addListener(this);
        try {
            this.fileAlterationObserver.initialize();
        } catch (Exception e) {
        }
    }
1097885
public void setResolvers(java.util.Collection<Resolver> resolvers) {
        if (resolvers == null) {
            this.resolvers = null;
            return;
        }

        this.resolvers = new java.util.ArrayList<Resolver>(resolvers);
    }
358325
function resolveFile(baseDirs, addType, fileName, type, cb)
{
  // The label this file will have in the output
  // For hbs views, this is the name that it will be save as into the template array.
  var label = pathlib.basename(fileName);

  // Label can be overridden with entries of the form: "label:file-name-or-path"
  var idx = fileName.indexOf(':');
  if ( idx > 0 )
  {
    label = fileName.substr(0,idx);
    fileName = fileName.substr(idx+1);
  }

  // Construct a list of paths to check
  var paths = [];
  baseDirs.forEach(function(baseDir) {
    if ( addType )
      baseDir += '/'+type;

    // Search for exact filename
    paths.push(pathlib.resolve(baseDir,fileName));

    // And with the type as an extension
    paths.push(pathlib.resolve(baseDir,fileName+'.'+type));

    // Special case 'view' because it used to mean hbs
    if ( type == 'view' )
    {
      VIEW_TYPES.forEach(function(altType) {
        paths.push(pathlib.resolve(baseDir,fileName+'.'+altType));
      });
    }
  });

  // Async
  if ( cb )
  {
    async.detectSeries(paths, fs.exists, function(result) {
      if ( result )
        return cb(undefined, label+':'+result);
      else
        return cb(new Error(errStr));
    });
  }
  else
  {
    // Sync
    for ( i=0 ; i < paths.length ; i++ )
    {
      if ( fs.existsSync(paths[i]) )
      {
        return label+':'+paths[i];
      }
    }

    throw new Error('Unable to find source ' + type + ' file for ' + fileName + ' in ' + paths.join(', '));
  }
}
306533
def resolve_template(template):
    ""
    if isinstance(template, (list, tuple)):
        return loader.select_template(template)
    elif isinstance(template, basestring):
        try:
            return loader.get_template(template)
        except TemplateDoesNotExist:
            return None
    else:
        return template
401533
private void initConfigPropertyResolver(ServletContext context) {
		String configPropertyResolverClass = getInitParameter("configPropertyResolverClass");
		// Load a custom class to set configPropertyResolver
		configPropResolver = null;
		if (null != configPropertyResolverClass) {
			configPropResolver = (ConfigPropertyResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configPropertyResolverClass);
			if (configPropResolver instanceof ServletContextAware) {
				((ServletContextAware) configPropResolver).setServletContext(context);
			}
		}
	}
178535
@Override
    public void initialize(ExtensionContext context) {
        // IMPORTANT: Management API version != xsd version! Not all Management API changes result in XSD changes
        SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, InfinispanSchema.CURRENT.getVersion());
        // Create the path resolver handler
        final ResolvePathHandler resolvePathHandler;
        final PathManager pathManager;
        if (context.getProcessType().isServer()) {
            resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager())
                    .setPathAttribute(FileStoreResource.PATH)
                    .setRelativeToAttribute(FileStoreResource.RELATIVE_TO)
                    .build();
            pathManager = context.getPathManager();
        } else {
            resolvePathHandler = null;
            pathManager = null;
        }

        subsystem.registerSubsystemModel(InfinispanSubsystemRootResource.create(resolvePathHandler, pathManager, context.isRuntimeOnlyRegistrationValid()));
        subsystem.registerXMLElementWriter(InfinispanSubsystemXMLWriter::new);
    }
291286
function resolveResource(ref, baseURI){
    // ref ~ "#123"
    if (/^#\d+$/.test(ref))
      return templateList[ref.substr(1)];

    // ref ~ "id:foo"
    if (/^id:/.test(ref))
      return resolveSourceByDocumentId(ref.substr(3));

    // ref ~ "foo.bar.baz"
    if (/^[a-z0-9\.]+$/i.test(ref) && !/\.tmpl$/.test(ref))
      return getSourceByPath(ref);

    // ref ~ "./path/to/file.tmpl"
    return basis.resource(basis.resource.resolveURI(ref, baseURI, '<b:include src=\"{url}\"/>'));
  }
385707
private void initEntityResolver() {
        final String entityResolveClazzName = System.getProperty( ExtensibleXmlParser.ENTITY_RESOLVER_PROPERTY_NAME );
        if ( entityResolveClazzName != null && entityResolveClazzName.length() > 0 ) {
            try {

                final Class entityResolverClazz = classLoader.loadClass( entityResolveClazzName );
                this.entityResolver = (EntityResolver) entityResolverClazz.newInstance();
            } catch ( final Exception ignoreIt ) {
            }
        }
    }
306374
private function initializeForPrefix(): void
    {
        $keys = AdapterUtil::getPropertyValue($this, 'keys');
        $values = AdapterUtil::getPropertyValue($this, 'values');

        if (null === $values) {
            $file = AdapterUtil::getPropertyValue($this, 'file');
            $values = @(include $file) ?: [];

            AdapterUtil::setPropertyValue($this, 'keys', $keys);
            AdapterUtil::setPropertyValue($this, 'values', $values);
        }
    }
501590
def resolve_files(file_or_dir_path, options = {}, &block)
      options = {
        # Set to :template when calling to consider references to template
        # files from an import library
        import: false
      }.merge(options)
      [file_or_dir_path].flatten.each do |file_or_dir_path|
        path = inject_import_path(file_or_dir_path, type: options[:import]) if options[:import]
        path = clean_path_to(file_or_dir_path, options)
        self.base_directory = path unless options[:internal_call]
        if path.directory?
          Dir.glob("#{path}/*").sort.each do |file|
            resolve_files(file, { internal_call: true }.merge(options), &block)
          end
        else
          # Ignore files with the given prefix if supplied, but only if this is a file that
          # has been found, if explicitly asked to compile a file from the caller do it regardless
          if options[:ignore_with_prefix] && options[:internal_call]
            return nil if path.basename.to_s =~ /^#{options[:ignore_with_prefix]}/
          end
          yield path
        end
      end
    end
149965
def add_implicit_resolver(tag, regexp, first=None,
        Loader=Loader, Dumper=Dumper):
    
    Loader.add_implicit_resolver(tag, regexp, first)
    Dumper.add_implicit_resolver(tag, regexp, first)