【翻译】JET 注释语法索引
JET 模板可能包含注释字符之间 <%-- 和 --%>。 只是他们可能会影响空白去除规则,有对此的模板的执行没有影响评论。 JET 评论是作为 Java 行注释复制到生成的 Java 类。
JET 模板接受两个特别标记注释的第一个非空白行中。 标记 '@ 头' 将导致要发出作为生成的 Java 类文件标头注释的注释。 这可用于生成的 Java 代码中插入版权通告。 标记 @ class 将导致要发出为类生成的 Java 类的 Java 文档注释的注释。
有效的评论
注释可能会跨越几个的行,并可能包含的任何文本。 以下是 JET 评论的示例:
<%-- @header This comment will appear as the file header comment in the generated Java code --%> <%-- @class This comment will appear as the Java class doc comment in the generated Java code --%> <%-- This comment will not appear in the template output --%> <%-- This directive is not used <%@taglib id="org.eclipse.jet.controlTags" prefix="cc"%> --%>
<%@taglib id="org.eclipse.jet.controlTags" <%-- illegal comment --%> prefix="cc" %>
<\%-- this will show in the template output --%\>