1 52 53 package freemarker.core; 54 55 58 public final class Comment extends TemplateElement { 59 60 private final String text; 61 62 Comment(String text) { 63 this.text = text; 64 } 65 66 void accept(Environment env) { 67 } 69 70 public String getCanonicalForm() { 71 return "<#--" + text + "-->"; 72 } 73 74 public String getDescription() { 75 String s = text.trim(); 76 if (s.length() > 20) { 77 s = s.substring(0, 20) + "..."; 78 } 79 return "comment (" + s + ")"; 80 } 81 82 public String getText() { 83 return text; 84 } 85 } 86 | Popular Tags |