return TemplateLookupResult.from(path, findTemplateSource(path)); return TemplateLookupResult.from(path, findTemplateSource(path)); Object templateSource = findTemplateSource(fullPath); if (templateSource != null) { return TemplateLookupResult.from(fullPath, templateSource); return TemplateLookupResult.createNegativeResult();
String path = buf.append(localeName).append(suffix).toString(); TemplateLookupResult lookupResult = lookupWithAcquisitionStrategy(path); if (lookupResult.isPositive()) { return lookupResult;
if (!newLookupResult.isPositive()) { if (debug) { LOG.debug(debugName + " no source found."); final Object newLookupResultSource = newLookupResult.getTemplateSource(); lastModified = templateLoader.getLastModified(newLookupResultSource); boolean lastModifiedNotChanged = lastModified == cachedTemplate.lastModified; if (!newLookupResult.isPositive()) { storeNegativeLookup(tk, cachedTemplate, null); return null; Object source = newLookupResult.getTemplateSource(); cachedTemplate.source = source; Template template = loadTemplate( templateLoader, source, name, newLookupResult.getTemplateSourceName(), locale, customLookupCondition, encoding, parseAsFTL); cachedTemplate.templateOrException = template; if (newLookupResult != null && newLookupResult.isPositive()) { templateLoader.closeTemplateSource(newLookupResult.getTemplateSource());
/** * Creates a not-found lookup result that then can be used as the return value of * {@link TemplateLookupStrategy#lookup(TemplateLookupContext)}. (In the current implementation it just always * returns the same static singleton, but that might need to change in the future.) */ public TemplateLookupResult createNegativeLookupResult() { return TemplateLookupResult.createNegativeResult(); }
if (!newLookupResult.isPositive()) { if (debug) { LOG.debug(debugName + " no source found."); final Object newLookupResultSource = newLookupResult.getTemplateSource(); lastModified = templateLoader.getLastModified(newLookupResultSource); boolean lastModifiedNotChanged = lastModified == cachedTemplate.lastModified; if (!newLookupResult.isPositive()) { storeNegativeLookup(tk, cachedTemplate, null); return null; Object source = newLookupResult.getTemplateSource(); cachedTemplate.source = source; Template template = loadTemplate( templateLoader, source, name, newLookupResult.getTemplateSourceName(), locale, customLookupCondition, encoding, parseAsFTL); cachedTemplate.templateOrException = template; if (newLookupResult != null && newLookupResult.isPositive()) { templateLoader.closeTemplateSource(newLookupResult.getTemplateSource());
/** Used internally to create the appropriate kind of result from the parameters. */ static TemplateLookupResult from(String templateSourceName, Object templateSource) { return templateSource != null ? new PositiveTemplateLookupResult(templateSourceName, templateSource) : createNegativeResult(); }
if (!newLookupResult.isPositive()) { if (debug) { LOG.debug(debugName + " no source found."); final Object newLookupResultSource = newLookupResult.getTemplateSource(); lastModified = templateLoader.getLastModified(newLookupResultSource); boolean lastModifiedNotChanged = lastModified == cachedTemplate.lastModified; if (!newLookupResult.isPositive()) { storeNegativeLookup(tk, cachedTemplate, null); return null; Object source = newLookupResult.getTemplateSource(); cachedTemplate.source = source; Template template = loadTemplate( templateLoader, source, name, newLookupResult.getTemplateSourceName(), locale, customLookupCondition, encoding, parseAsFTL); cachedTemplate.templateOrException = template; if (newLookupResult != null && newLookupResult.isPositive()) { templateLoader.closeTemplateSource(newLookupResult.getTemplateSource());
return TemplateLookupResult.from(path, findTemplateSource(path)); return TemplateLookupResult.from(path, findTemplateSource(path)); Object templateSource = findTemplateSource(fullPath); if (templateSource != null) { return TemplateLookupResult.from(fullPath, templateSource); return TemplateLookupResult.createNegativeResult();
/** * Creates a not-found lookup result that then can be used as the return value of * {@link TemplateLookupStrategy#lookup(TemplateLookupContext)}. (In the current implementation it just always * returns the same static singleton, but that might need to change in the future.) */ public TemplateLookupResult createNegativeLookupResult() { return TemplateLookupResult.createNegativeResult(); }
String path = buf.append(localeName).append(suffix).toString(); TemplateLookupResult lookupResult = lookupWithAcquisitionStrategy(path); if (lookupResult.isPositive()) { return lookupResult;
return TemplateLookupResult.from(path, findTemplateSource(path)); return TemplateLookupResult.from(path, findTemplateSource(path)); Object templateSource = findTemplateSource(fullPath); if (templateSource != null) { return TemplateLookupResult.from(fullPath, templateSource); return TemplateLookupResult.createNegativeResult();
/** * Creates a not-found lookup result that then can be used as the return value of * {@link TemplateLookupStrategy#lookup(TemplateLookupContext)}. (In the current implementation it just always * returns the same static singleton, but that might need to change in the future.) */ public TemplateLookupResult createNegativeLookupResult() { return TemplateLookupResult.createNegativeResult(); }
String path = buf.append(localeName).append(suffix).toString(); TemplateLookupResult lookupResult = lookupWithAcquisitionStrategy(path); if (lookupResult.isPositive()) { return lookupResult;
/** Used internally to create the appropriate kind of result from the parameters. */ static TemplateLookupResult from(String templateSourceName, Object templateSource) { return templateSource != null ? new PositiveTemplateLookupResult(templateSourceName, templateSource) : createNegativeResult(); }
/** Used internally to create the appropriate kind of result from the parameters. */ static TemplateLookupResult from(String templateSourceName, Object templateSource) { return templateSource != null ? new PositiveTemplateLookupResult(templateSourceName, templateSource) : createNegativeResult(); }