What is Apache FreeMarker?

来源:互联网 发布:overlay sdn网络分为 编辑:程序博客网 时间:2024/05/22 13:20

What is Apache FreeMarker?

Apache FreeMarker是什么?


Apache FreeMarker is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language (not a full-blown programming language like PHP). You meant to prepare the data to display in a real programming language, like issue database queries and do business calculations, and then the template displays that already prepared data. In the template you are focusing on how to present the data, and outside the template you are focusing on what data to present.

FreeMarker是一个Apache模板引擎:一个java 库生成文本输出(HTML网页,电子邮件,配置 文件、源代码等)基于模板和数据变化。模板 写在FreeMarker模板语言(FTL),这是一个简单的, 专业语言(不成熟的编程语言如PHP。你 准备数据,在一个真正的编程语言显示,像 问题数据库查询和做生意的计算,然后模板 显示已经准备数据。在你的模板的重点是 如何呈现数据,并在你的重点是什么 数据呈现模板。


Figure

This approach is often referred to as the MVC (Model View Controller) pattern, and is particularly popular for dynamic web pages. It helps in separating web page designers (HTML authors) from developers (Java programmers usually). Designers won't face complicated logic in templates, and can change the appearance of a page without programmers having to change or recompile code.

这种方法通常被称为MVC(模型-视图- 控制器)模式,特别是流行的动态网页。它 帮助分离的网页设计师(HTML作者)从开发商 (java程序员通常。设计师不面临复杂的逻辑 模板,并可以更改页面的外观没有程序员 需要修改或重新编译代码。


While FreeMarker was originally created for generating HTML pages in MVC web application frameworks, it isn't bound to servlets or HTML or anything web-related. It's used in non-web application environments as well.

虽然FreeMarker最初产生在 MVC的Web应用框架的HTML页面中创建的,它不是必然的servlet或HTML或 什么网站相关。这是用在非Web应用的环境 好。


See the Manual for more details...

看到更多的 细节手册…


Disclaimer: Apache FreeMarker is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.


disclaimer:Apache FreeMarker是一个努力接受孵化在Apache软件 基金会(ASF),由Apache孵化器。 孵化需要的所有新项目,直到进一步的 审查表明,基础设施,通讯,和决策 制作过程稳定在一个一致的其他方式 成功的ASF。孵化状态不一定是代码的完整性和稳定性的 反射,它表明 ,项目尚未得到充分肯定 ASF。

Features

A few highlights of FreeMarker:


功能特色

几个亮点FreeMarker:


  • Powerful template language: Conditional blocks, iterations, assignments, string and arithmetic operations and formatting, macros and functions, including other templates, escaping by default (optional), and many more

  • Multipurpose and lightweight: Zero dependencies, any output format, can load templates from any place (pluggable), many configuration options

  • Internationalization/localization-aware: Locale sensitive number and date/time formatting, localized template variations.

  • XML processing capabilities: Drop XML DOM-s into the data-model and traverse them, or even process them declaratively

  • Versatile data-model: Java objects are exposed to the template as a tree of variables through pluggable adapters, which decides how the template sees them.

  • 强大的模板语言:条件块,迭代, 作业、字符串和算术运算和格式,宏 和功能,包括其他模板,使用默认 (可选),和许多

  • 多用途轻便:零依赖,任何输出 格式,可以从任何地方加载模板(可插拔),许多 配置选项

  • 国际化/本地化意识:现场敏感 号码和日期/时间格式,局部模板 变化。

  • XML处理能力:降到 dom-s XML数据模型和遍历过程,甚至他们 声明

  • 通用的数据模型:java对象暴露在模板 作为树的变量通过插拔适配器,它决定如何 模板看到他们。


License

FreeMarker is Free software, licensed under the Apache License, Version 2.0. See the license here....

As of 2.3.24-pre01 (2015-09-02) the copyright owner in the license has changed to the Apache Software Foundation, as the project has started Apache Incubation (see disclaimer earlier).


许可证

自由软件在freemarker is the Apache许可证,执照, version 2.0。查看许可证 这里…。

作为2.3.24-pre01(2015-09-02)的许可证 版权所有者已更改为Apache软件基金会,为项目 开始Apache 孵化(See放弃earlier)。






原创粉丝点击