【翻译】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"%>
     --%>

无效的评论
注释可能不会出现在其他 JET 元素内。 以下是非法的评论:

<%@taglib id="org.eclipse.jet.controlTags" <%-- illegal comment --%>
          prefix="cc" %>

转义字符的注释
若要发出的字符 <%-- 一的模板输出输入 <\%--。 发出 --%>,输入 --%\>。
以下是一个转义的 JET 评论的一个示例:

<\%-- this will show in the template output --%\>

猜你喜欢

转载自liu-yi126.iteye.com/blog/1170875
JET