ScanTemplates Method.
543571
public void scanTemplates(LineNumberReader reader)
    {
        try {
            String string;
            boolean bTemplate = false;
            while ((string = reader.readLine()) != null)
            {
                if (string.indexOf("<xsl:template ") != -1)
                    bTemplate = true;
                if (bTemplate)
                {
                    int iStart = string.indexOf("match=\"") + 7;
                    int iEnd = string.indexOf('\"', iStart);
                    if (iStart != 6)
                        if (iEnd != -1)
                        {
                            String strMatch = string.substring(iStart, iEnd);
                            this.addMatch(strMatch, false);
                        }               
                    iStart = string.indexOf("name=\"") + 6;
                    iEnd = string.indexOf('\"', iStart);
                    if (iStart != 5)
                        if (iEnd != -1)
                        {
                            String strName = string.substring(iStart, iEnd);
                            this.addName(strName, false);
                        }               
                }
                if (string.indexOf(">") != -1)
                    bTemplate = false;
            }
        } catch (FileNotFoundException ex)  {
            ex.printStackTrace();
        } catch (IOException ex)    {
            ex.printStackTrace();
        }
    }
654572
def scanned(self):
        """"""
        if self.request["Select"] == "COUNT":
            while not self.exhausted:
                next(self, None)
        return self._scanned
1182271
private void initTemplates() throws Exception {
        if (templates != null && templates.length > 0) {
            for (String template : templates) {
                Assert.hasText(template, "Can not read template in ["
                        + template
                        + "]. Check that templates is not empty.");
                createTemplate(client.getLowLevelClient(), classpathRoot, template, forceTemplate);
            }
        }
    }
1059361
def template(self):
        """"""
        if self._template:
            return self._template

        template_json = self.read_template(self.args.tmplname)

        self._template = loads(template_json)
        return self._template
419681
public void loadTemplates() throws TemplateException {
        loadStrategyI.loadTemplates();
        this.templateSet = loadStrategyI.getTemplates();
        this.templateOrders = loadStrategyI.getOrders();
    }
1258328
private void scanFields(Class<?> c)
    {
        if (!c.isInterface())
        {
            Field[] fields = c.getDeclaredFields();
            for (Field field : fields)
            {
                String fieldName = field.getName();

                if (pairs.containsKey(fieldName))
                {
                    if (field.isAnnotationPresent(UriTransient.class))
                    {
                        pairs.remove(fieldName);
                    }
                    else if (field.isAnnotationPresent(VarName.class))
                    {
                        String name = field.getAnnotation(VarName.class).value();
                        pairs.put(name, pairs.get(fieldName));
                        pairs.remove(fieldName);
                    }
                }
            }
        }
      /*
       * We still need to scan the fields of the super class if its
       * not Object to check for annotations. There might be a better
       * way to do this.
       */
        if (!c.getSuperclass().equals(Object.class))
        {
            scanFields(c.getSuperclass());
        }
    }
683537
protected void checkTemplate() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_simpleFieldFolderName.getValue())) {
            return;
        }
        if (!m_clonedCms.existsResource(getSiteRoot())) {
            return;
        }
        try {
            String templateValue = m_clonedCms.readPropertyObject(
                getSiteRoot(),
                CmsPropertyDefinition.PROPERTY_TEMPLATE,
                false).getValue();
            m_simpleFieldTemplate.addItem(templateValue);
            m_simpleFieldTemplate.setValue(templateValue);
        } catch (CmsException e) {
            //
        }
    }
896379
public function getTemplates()
    {
        $templates = SSViewer::get_templates_by_class($this, '', __CLASS__);
        // Prefer any custom template
        if ($this->getTemplate()) {
            array_unshift($templates, $this->getTemplate());
        }
        return $templates;
    }
53794
def get_templates(self, context, template_name=None):
        "  "
        if not template_name:
            template_name = self.template_name

        kw = {}
        if 'object' in context:
            o = context['object']
            kw['slug'] = o.slug

        if context.get('content_type', False):
            ct = context['content_type']
            kw['app_label'] = ct.app_label
            kw['model_label'] = ct.model

        return get_templates(template_name, category=context['category'], **kw)
1278121
def apply_template(template, *args, **kw):
    """"""
    if six.callable(template):
        return template(*args, **kw)
    if isinstance(template, six.string_types):
        return template
    if isinstance(template, collections.Mapping):
        return template.__class__((k, apply_template(v, *args, **kw)) for k, v in template.items())
    if isinstance(template, collections.Iterable):
        return template.__class__(apply_template(v, *args, **kw) for v in template)
    return template
263281
def get_scan_nr(element, attribname):
    """"""
    info = element.attrib[attribname]
    infomap = {y[0]: y[1] for y in [x.split('=') for x in info.split()]}
    return infomap['scan']
469669
public void processNewTemplates( Collection<TemplateEntry> newTemplates ) {

		if( this.dm != null ) {
			for( ManagedApplication ma : this.dm.applicationMngr().getManagedApplications()) {
				Collection<TemplateEntry> filteredTemplates = TemplateUtils.findTemplatesForApplication( ma.getName(), newTemplates );
				generate( ma.getApplication(), filteredTemplates );
			}
		}
	}
362832
public TemplateStats[] getTemplateStats() {
    	Collection<TemplateStats> collection = mStatsMap.values();
    	TemplateStats[] result = null;
    	if (collection.size() > 0) {
    		result = collection.toArray(new TemplateStats[collection.size()]);
    	}
    	return result;
    }
532426
def _get_template(querystring_key, mapping):
    """"""
    default = None
    try:
        template_and_keys = mapping.items()
    except AttributeError:
        template_and_keys = mapping
    for template, key in template_and_keys:
        if key is None:
            key = PAGE_LABEL
            default = template
        if key == querystring_key:
            return template
    return default
1135774
public void scanPackages(String... packagesToScan) throws HibernateException {
        try {
            for (String pkg : packagesToScan) {
                String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
                        ClassUtils.convertClassNameToResourcePath(pkg) + RESOURCE_PATTERN;
                Resource[] resources = resourcePatternResolver.getResources(pattern);
                MetadataReaderFactory readerFactory = new CachingMetadataReaderFactory(resourcePatternResolver);
                for (Resource resource : resources) {
                    if (resource.isReadable()) {
                        MetadataReader reader = readerFactory.getMetadataReader(resource);
                        String className = reader.getClassMetadata().getClassName();
                        if (matchesFilter(reader, readerFactory)) {
                            Class<?> loadedClass = resourcePatternResolver.getClassLoader().loadClass(className);
                            addAnnotatedClasses(loadedClass);
                        }
                    }
                }
            }
        }
        catch (IOException ex) {
            throw new MappingException("Failed to scan classpath for unlisted classes", ex);
        }
        catch (ClassNotFoundException ex) {
            throw new MappingException("Failed to load annotated classes from classpath", ex);
        }
    }
1310077
def outputtemplates(self):
        """"""
        outputtemplates = []
        for o in self.output:
            if isinstance(o, ParameterCondition):
                outputtemplates += o.allpossibilities()
            else:
                assert isinstance(o, OutputTemplate)
                outputtemplates.append(o)
        return outputtemplates
635500
def rescan(self):
        """"""
        self._pathfiles = {}
        for path in self.basepaths:
            self.scan_path(path)