freemarker.template.Version.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中freemarker.template.Version.<init>()方法的一些代码示例,展示了Version.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.<init>()方法的具体详情如下:
包路径:freemarker.template.Version
类名称:Version
方法名:<init>

Version.<init>介绍

[英]Creates an object based on the int value that uses the same kind of encoding as #intValue().
[中]基于使用与#intValue()相同编码的int值创建对象。

代码示例

代码示例来源:origin: org.freemarker/freemarker

/**
 * @deprecated Use {@link #Configuration(Version)}, or
 *    as last chance, {@link #setIncompatibleImprovements(Version)} instead.
 */
@Deprecated
public void setIncompatibleEnhancements(String version) {
  setIncompatibleImprovements(new Version(version));
}

代码示例来源:origin: org.freemarker/freemarker

/**
 * Converts a version number string to an integer for easy comparison.
 * The version number must start with numbers separated with
 * dots. There can be any number of such dot-separated numbers, but only
 * the first three will be considered. After the numbers arbitrary text can
 * follow, and will be ignored.
 * 
 * The string will be trimmed before interpretation.
 * 
 * @return major * 1000000 + minor * 1000 + micro
 */
public static int versionStringToInt(String version) {
  return new Version(version).intValue();
}

代码示例来源:origin: org.freemarker/freemarker

if (isVersion) {
  try {
    return new Version(numStr);
  } catch (IllegalArgumentException e) {
    throw new _ObjectBuilderSettingEvaluationException("Malformed version number: " + numStr, e);

代码示例来源:origin: org.freemarker/freemarker

/**
 * @Deprecated This is an internal API of FreeMarker; will be changed in 2.4.
 */
public FMParser(Template template, Reader reader, boolean strictSyntaxMode, boolean whitespaceStripping,
    int tagSyntax, int namingConvention, int incompatibleImprovements) {
  this(template, reader,
      new LegacyConstructorParserConfiguration(
          strictSyntaxMode, whitespaceStripping,
          tagSyntax, LEGACY_INTERPOLATION_SYNTAX, namingConvention,
          template != null ? template.getParserConfiguration().getAutoEscapingPolicy()
              : Configuration.ENABLE_IF_DEFAULT_AUTO_ESCAPING_POLICY,
          template != null ? template.getParserConfiguration().getOutputFormat()
              : null,
          template != null ? template.getParserConfiguration().getRecognizeStandardFileExtensions()
              : null,
          template != null ? template.getParserConfiguration().getTabSize()
              : null,
          new Version(incompatibleImprovements),
          template != null ? template.getArithmeticEngine() : null));
}

代码示例来源:origin: org.freemarker/freemarker

} else if (INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE.equals(name)
    || INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE.equals(name)) {
  setIncompatibleImprovements(new Version(value));
} else if (INCOMPATIBLE_ENHANCEMENTS.equals(name)) {
  setIncompatibleEnhancements(value);

代码示例来源:origin: spring-projects/spring-roo

try {
 Configuration cfg = new Configuration(new Version(2, 3, 23));
 cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);

代码示例来源:origin: com.sparkjava/spark-template-freemarker

private Configuration createDefaultConfiguration() {
  Configuration configuration = new Configuration(new Version(2, 3, 23));
  configuration.setClassForTemplateLoading(FreeMarkerEngine.class, "");
  return configuration;
}

代码示例来源:origin: perwendel/spark-template-engines

private Configuration createDefaultConfiguration() {
  Configuration configuration = new Configuration(new Version(2, 3, 23));
  configuration.setClassForTemplateLoading(FreeMarkerEngine.class, "");
  return configuration;
}

代码示例来源:origin: com.ksc.mission.base/code-gen

public Generation(ModelView mv, TemplateType templateType) {
  config = new Configuration(new Version("2.3.23"));
  config.setClassForTemplateLoading(Generation.class, "/");
  config.setDefaultEncoding("UTF-8");
  this.modelView = mv;
  this.templateType = templateType;
}

代码示例来源:origin: BoD/android-prefs

private Configuration getFreemarkerConfiguration() {
  if (mFreemarkerConfiguration == null) {
    mFreemarkerConfiguration = new Configuration(new Version(2, 3, 26));
    mFreemarkerConfiguration.setClassForTemplateLoading(getClass(), "");
  }
  return mFreemarkerConfiguration;
}

代码示例来源:origin: org.freemarker/freemarker-gae

/**
 * @deprecated Use {@link #Configuration(Version)}, or
 *    as last chance, {@link #setIncompatibleImprovements(Version)} instead.
 */
@Deprecated
public void setIncompatibleEnhancements(String version) {
  setIncompatibleImprovements(new Version(version));
}

代码示例来源:origin: com.sgota.tools/tkcg-core

/**
 * 构造方法.
 */
private TemplateHelper(){
  configuration = new Configuration(new Version(2, 3, 0));
  configuration.setNumberFormat("###############");
  configuration.setBooleanFormat("true,false");
  configuration.setDefaultEncoding("UTF-8");
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

/**
 * @deprecated Use {@link #Configuration(Version)}, or
 *    as last chance, {@link #setIncompatibleImprovements(Version)} instead.
 */
@Deprecated
public void setIncompatibleEnhancements(String version) {
  setIncompatibleImprovements(new Version(version));
}

代码示例来源:origin: joliciel-informatique/talismane

private Template getTemplate(Reader templateReader) throws IOException {
 Configuration cfg = new Configuration(new Version(2, 3, 23));
 cfg.setCacheStorage(new NullCacheStorage());
 cfg.setObjectWrapper(new DefaultObjectWrapper(new Version(2, 3, 23)));
 return new Template("freemarkerTemplate", templateReader, cfg);
}

代码示例来源:origin: joliciel-informatique/talismane

private Template getTemplate(Reader templateReader) throws IOException {
 Configuration cfg = new Configuration(new Version(2, 3, 23));
 cfg.setCacheStorage(new NullCacheStorage());
 cfg.setObjectWrapper(new DefaultObjectWrapper(new Version(2, 3, 23)));
 return new Template("freemarkerTemplate", templateReader, cfg);
}

代码示例来源:origin: joliciel-informatique/talismane

private Template getTemplate(Reader templateReader) throws IOException {
 Configuration cfg = new Configuration(new Version(2, 3, 23));
 cfg.setCacheStorage(new NullCacheStorage());
 cfg.setObjectWrapper(new DefaultObjectWrapper(new Version(2, 3, 23)));
 return new Template("freemarkerTemplate", templateReader, cfg);
}

代码示例来源:origin: joliciel-informatique/talismane

public StandoffWriter(Writer writer, TalismaneSession session) throws IOException {
 punctuationDepLabel = session.getTransitionSystem().getDependencyLabelSet().getPunctuationLabel();
 this.writer = writer;
 Configuration cfg = new Configuration(new Version(2, 3, 23));
 cfg.setCacheStorage(new NullCacheStorage());
 cfg.setObjectWrapper(new DefaultObjectWrapper(new Version(2, 3, 23)));
 InputStream inputStream = StandoffWriter.class.getResourceAsStream("standoff.ftl");
 Reader templateReader = new BufferedReader(new InputStreamReader(inputStream));
 this.template = new Template("freemarkerTemplate", templateReader, cfg);
}

代码示例来源:origin: goudai/gd-generator

protected void init() throws Exception {
  freemarkerConfiguration = new Configuration(new Version(config.getFreemakerVersion()));
  freemarkerConfiguration.setDefaultEncoding(config.getDefaultEncoding());
  freemarkerConfiguration.setClassForTemplateLoading(getClass(), "/io/gd/generator/template");
  genLog = new GenLog(config.getGenLogFile());
}

代码示例来源:origin: net.onedaybeard.artemis/artemis-odb-processor

ModelFormatter() {
  config = new Configuration();
  config.setClassForTemplateLoading(getClass(), "");
  config.setIncompatibleImprovements(new Version(2, 3, 20));
  config.setDefaultEncoding("UTF-8");
  config.setLocale(Locale.US);
  config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
}

代码示例来源:origin: org.alfresco/alfresco-repository

protected Configuration getFreemarkerConfiguration(RepoCtx ctx)
{
  Configuration cfg = new Configuration();
  cfg.setObjectWrapper(new DefaultObjectWrapper());
  // custom template loader
  cfg.setTemplateLoader(new TemplateWebScriptLoader(ctx.getRepoEndPoint(), ctx.getTicket()));
  // TODO review i18n
  cfg.setLocalizedLookup(false);
  cfg.setIncompatibleImprovements(new Version(2, 3, 20));
  cfg.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
  return cfg;
}

相关文章