當前位置: 首頁>>代碼示例>>Java>>正文


Java Configuration.setLogTemplateExceptions方法代碼示例

本文整理匯總了Java中freemarker.template.Configuration.setLogTemplateExceptions方法的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.setLogTemplateExceptions方法的具體用法?Java Configuration.setLogTemplateExceptions怎麽用?Java Configuration.setLogTemplateExceptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在freemarker.template.Configuration的用法示例。


在下文中一共展示了Configuration.setLogTemplateExceptions方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: templateConfiguration

import freemarker.template.Configuration; //導入方法依賴的package包/類
private static Configuration templateConfiguration() {
  Configuration configuration = new Configuration(Configuration.VERSION_2_3_26);
  configuration.setDefaultEncoding("UTF-8");
  configuration.setLogTemplateExceptions(false);
  try {
    configuration.setSetting("object_wrapper",
        "DefaultObjectWrapper(2.3.26, forceLegacyNonListCollections=false, "
            + "iterableSupport=true, exposeFields=true)");
  } catch (TemplateException e) {
    e.printStackTrace();
  }
  configuration.setAPIBuiltinEnabled(true);
  configuration.setClassLoaderForTemplateLoading(ClassLoader.getSystemClassLoader(),
      "templates/ccda");
  return configuration;
}
 
開發者ID:synthetichealth,項目名稱:synthea_java,代碼行數:17,代碼來源:CCDAExporter.java

示例2: prepareConfiguration

import freemarker.template.Configuration; //導入方法依賴的package包/類
private static Configuration prepareConfiguration() {
  Configuration result = new Configuration(Configuration.VERSION_2_3_26);

  result.setNumberFormat("computer");
  result.setDefaultEncoding(StandardCharsets.UTF_8.name());
  result.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
  result.setLogTemplateExceptions(false);

  return result;
}
 
開發者ID:dotwebstack,項目名稱:dotwebstack-framework,代碼行數:11,代碼來源:TemplateProcessor.java

示例3: init

import freemarker.template.Configuration; //導入方法依賴的package包/類
public void init() throws IOException {
    ClassTemplateLoader ctl = new ClassTemplateLoader(Application.class, "/freemarker");
    MultiTemplateLoader mtl = new MultiTemplateLoader(new TemplateLoader[] {ctl});

    Configuration cfg = new Configuration(Configuration.VERSION_2_3_25);
    cfg.setTemplateLoader(mtl);
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    cfg.setLogTemplateExceptions(false);

    Pair<String, Template> clusterResourceQuota = new ImmutablePair<String, Template>("ClusterResourceQuota-ForUser", cfg.getTemplate("ClusterResourceQuota-ForUser.ftlh"));
    Pair<String, Template> bestEffortResourceLimits = new ImmutablePair<String, Template>("LimitRange-BestEffortResourceLimits", cfg.getTemplate("LimitRange-BestEffortResourceLimits.ftlh"));
    Pair<String, Template> burstableResourceLimits = new ImmutablePair<String, Template>("LimitRange-BurstableResourceLimits", cfg.getTemplate("LimitRange-BurstableResourceLimits.ftlh"));
    Pair<String, Template> maxImageCounts = new ImmutablePair<String, Template>("LimitRange-MaxImageCounts", cfg.getTemplate("LimitRange-MaxImageCounts.ftlh"));
    Pair<String, Template> bestEffort = new ImmutablePair<String, Template>("ResourceQuota-BestEffort", cfg.getTemplate("ResourceQuota-BestEffort.ftlh"));
    Pair<String, Template> notTerminatingAndNotBestEffort = new ImmutablePair<String, Template>("ResourceQuota-NotTerminating-And-NotBestEffort",
                                                                              cfg.getTemplate("ResourceQuota-NotTerminating-And-NotBestEffort.ftlh"));
    Pair<String, Template> terminating = new ImmutablePair<String, Template>("ResourceQuota-Terminating", cfg.getTemplate("ResourceQuota-Terminating.ftlh"));

    templates = Arrays.asList(clusterResourceQuota, bestEffortResourceLimits, burstableResourceLimits, maxImageCounts, bestEffort, notTerminatingAndNotBestEffort, terminating);
}
 
開發者ID:garethahealy,項目名稱:quota-limits-generator,代碼行數:22,代碼來源:YamlTemplateProcessor.java

示例4: JoomlaHugoConverter

import freemarker.template.Configuration; //導入方法依賴的package包/類
public JoomlaHugoConverter(NastyContentChecker nastyContentChecker,
                           JdbcTemplate template, String pathToOutput, String dbExtension,
                           boolean buildTags) throws IOException {

    this.dbExtension = dbExtension;

    this.nastyContentChecker = nastyContentChecker;
    this.template = template;
    this.pathToOutput = pathToOutput;
    this.buildTags = buildTags;

    Configuration cfg = new Configuration(Configuration.getVersion());
    cfg.setClassLoaderForTemplateLoading(ClassLoader.getSystemClassLoader(), "/");
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    cfg.setLogTemplateExceptions(false);

    categoryTemplate = cfg.getTemplate("categoryPage.toml.ftl");
    contentTemplate = cfg.getTemplate("defaultPage.toml.ftl");

    buildTags();
}
 
開發者ID:davetcc,項目名稱:hugojoomla,代碼行數:23,代碼來源:JoomlaHugoConverter.java

示例5: configuration

import freemarker.template.Configuration; //導入方法依賴的package包/類
@Singleton
@Provides
public static Configuration configuration(LinkHelper linkHelper, MultiTemplateLoader templateLoader) {
    try {
        freemarker.log.Logger.selectLoggerLibrary(Logger.LIBRARY_SLF4J);
        Configuration cfg = new freemarker.template.Configuration(Configuration.VERSION_2_3_25);
        cfg.setTagSyntax(freemarker.template.Configuration.SQUARE_BRACKET_TAG_SYNTAX);
        cfg.setLazyAutoImports(true);
        cfg.setLocale(Locale.GERMANY); // todo make configurable
        cfg.addAutoImport("saito", "saito.ftl");
        cfg.setSharedVariable("saitoLinkHelper", linkHelper);
        cfg.setDefaultEncoding("UTF-8");
        cfg.setLogTemplateExceptions(false);
        cfg.setTemplateLoader(templateLoader);
        return cfg;
    } catch (TemplateModelException | ClassNotFoundException e) {
        log.error("Error creating config", e);
        throw new IllegalStateException(e);
    }
}
 
開發者ID:marcobehler,項目名稱:saito,代碼行數:21,代碼來源:FreemarkerModule.java

示例6: TemplateService

import freemarker.template.Configuration; //導入方法依賴的package包/類
public TemplateService() {

		String templatePath = new File("").getAbsolutePath();
		System.out.println("Using template path '" + templatePath + "'.");
		
		try {
			config = new Configuration(Configuration.VERSION_2_3_25);
			config.setDirectoryForTemplateLoading(new File(templatePath));
			config.setDefaultEncoding("UTF-8");
			config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
			config.setLogTemplateExceptions(false);
		} catch (IOException e) {
			throw new FileLibraryException(e);
		}
		
	}
 
開發者ID:dvanherbergen,項目名稱:robotframework-filelibrary,代碼行數:17,代碼來源:TemplateService.java

示例7: PluginStatusReportViewBuilder

import freemarker.template.Configuration; //導入方法依賴的package包/類
private PluginStatusReportViewBuilder() throws IOException {
    configuration = new Configuration(Configuration.VERSION_2_3_23);
    configuration.setTemplateLoader(new ClassTemplateLoader(getClass(), "/"));
    configuration.setDefaultEncoding("UTF-8");
    configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    configuration.setLogTemplateExceptions(false);
    configuration.setDateTimeFormat("iso");
}
 
開發者ID:gocd,項目名稱:kubernetes-elastic-agents,代碼行數:9,代碼來源:PluginStatusReportViewBuilder.java

示例8: initializeTemplateConfiguration

import freemarker.template.Configuration; //導入方法依賴的package包/類
private static Configuration initializeTemplateConfiguration() throws IOException {
  Configuration cfg = new Configuration(Configuration.getVersion());
  cfg.setDefaultEncoding("UTF-8");
  cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
  cfg.setLogTemplateExceptions(false);
  return cfg;
}
 
開發者ID:tsiq,項目名稱:magic-beanstalk,代碼行數:8,代碼來源:FileGenerator.java

示例9: FreeMarkerService

import freemarker.template.Configuration; //導入方法依賴的package包/類
private FreeMarkerService(Builder bulder) {
     maxOutputLength = bulder.getMaxOutputLength();
     maxThreads = bulder.getMaxThreads();
     maxQueueLength = bulder.getMaxQueueLength();
     maxTemplateExecutionTime = bulder.getMaxTemplateExecutionTime();

     int actualMaxQueueLength = maxQueueLength != null
             ? maxQueueLength
             : Math.max(
                     MIN_DEFAULT_MAX_QUEUE_LENGTH,
                     (int) (MAX_DEFAULT_MAX_QUEUE_LENGTH_MILLISECONDS / maxTemplateExecutionTime));
     ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
             maxThreads, maxThreads,
             THREAD_KEEP_ALIVE_TIME, TimeUnit.MILLISECONDS,
             new BlockingArrayQueue<Runnable>(actualMaxQueueLength));
     threadPoolExecutor.allowCoreThreadTimeOut(true);
     templateExecutor = threadPoolExecutor;

     freeMarkerConfig = new Configuration(Configuration.getVersion());
     freeMarkerConfig.setNewBuiltinClassResolver(TemplateClassResolver.ALLOWS_NOTHING_RESOLVER);
     freeMarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
     freeMarkerConfig.setLogTemplateExceptions(false);
     freeMarkerConfig.setAttemptExceptionReporter(new AttemptExceptionReporter() {
@Override
public void report(TemplateException te, Environment env) {
	// Suppress it
}
     });
     freeMarkerConfig.setLocale(AllowedSettingValuesMaps.DEFAULT_LOCALE);
     freeMarkerConfig.setTimeZone(AllowedSettingValuesMaps.DEFAULT_TIME_ZONE);
     freeMarkerConfig.setOutputFormat(AllowedSettingValuesMaps.DEFAULT_OUTPUT_FORMAT);
     freeMarkerConfig.setOutputEncoding("UTF-8");
 }
 
開發者ID:apache,項目名稱:incubator-freemarker-online-tester,代碼行數:34,代碼來源:FreeMarkerService.java

示例10: processIndexPageTemplate

import freemarker.template.Configuration; //導入方法依賴的package包/類
private void processIndexPageTemplate(ProjectDescriptor projectDescriptor, CustomData customData) throws IOException, URISyntaxException, TemplateException {
    Configuration cfg = new Configuration(Configuration.VERSION_2_3_25);
    cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "template");
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    cfg.setLogTemplateExceptions(false);
    Map<String, Object> root = new HashMap<String, Object>();
    root.put("project", projectDescriptor);
    root.put("customData", customData);
    Template template = cfg.getTemplate("index.ftl");
    template.process(root, new FileWriter(new File(outputDir, "index.html")));
}
 
開發者ID:gradle-guides,項目名稱:gradle-site-plugin,代碼行數:13,代碼來源:FreemarkerSiteGenerator.java

示例11: init

import freemarker.template.Configuration; //導入方法依賴的package包/類
void init(final Class rootClass, final String basePath) {
    cfg = new Configuration(Configuration.VERSION_2_3_26);
    cfg.setClassForTemplateLoading(rootClass, basePath);
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    cfg.setLogTemplateExceptions(false);
}
 
開發者ID:trivago,項目名稱:cluecumber-report-plugin,代碼行數:8,代碼來源:TemplateConfiguration.java

示例12: createConfiguration

import freemarker.template.Configuration; //導入方法依賴的package包/類
private void createConfiguration(String basePackagePath) {
  cfg = new Configuration(Configuration.VERSION_2_3_26);
  cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), basePackagePath);
  cfg.setLogTemplateExceptions(false);
  setDefaultEncoding("UTF-8");
  setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
}
 
開發者ID:bertilmuth,項目名稱:requirementsascode,代碼行數:8,代碼來源:FreeMarkerEngine.java

示例13: createFreemarkerConfig

import freemarker.template.Configuration; //導入方法依賴的package包/類
public Configuration createFreemarkerConfig() throws IOException {
    final Configuration cfg = new Configuration(Configuration.VERSION_2_3_25);
    final File templateDirectory = findTemplateDirectory();
    cfg.setDirectoryForTemplateLoading(templateDirectory);
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
    cfg.setLogTemplateExceptions(false);

    return cfg;
}
 
開發者ID:blackducksoftware,項目名稱:hub-email-extension,代碼行數:11,代碼來源:EmailEngine.java

示例14: createConfiguration

import freemarker.template.Configuration; //導入方法依賴的package包/類
private static Configuration createConfiguration() {
  Configuration configuration = new Configuration(Configuration.VERSION_2_3_25);
  configuration.setClassForTemplateLoading(Templates.class, "/templates/appengine");
  configuration.setDefaultEncoding(StandardCharsets.UTF_8.name());
  configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
  configuration.setLogTemplateExceptions(false);
  return configuration;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:9,代碼來源:Templates.java

示例15: buildFreemarkerComment

import freemarker.template.Configuration; //導入方法依賴的package包/類
private String buildFreemarkerComment() {
    Configuration cfg = new Configuration(Configuration.getVersion());
    cfg.setDefaultEncoding("UTF-8");
    cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    cfg.setLogTemplateExceptions(false);

    try (StringWriter sw = new StringWriter()) {
        new Template(templateName, template, cfg).process(createContext(), sw);
        return StringEscapeUtils.unescapeHtml4(sw.toString());
    } catch (IOException | TemplateException e) {
        LOG.error("Failed to create template {}", templateName, e);
        throw MessageException.of("Failed to create template " + templateName);
    }
}
 
開發者ID:gabrie-allaigre,項目名稱:sonar-gitlab-plugin,代碼行數:15,代碼來源:AbstractCommentBuilder.java


注:本文中的freemarker.template.Configuration.setLogTemplateExceptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。