1 52 53 package freemarker.core; 54 55 60 final class TrimInstruction extends TemplateElement { 61 62 final boolean left, right; 63 64 TrimInstruction(boolean left, boolean right) { 65 this.left = left; 66 this.right = right; 67 } 68 69 void accept(Environment env) { 70 } 72 73 public String getCanonicalForm() { 74 if (left && right) { 75 return "<#t>"; 76 } 77 else if (left) { 78 return "<#lt>"; 79 } 80 else if (right) { 81 return "<#rt>"; 82 } 83 else { 84 return "<#nt>"; 85 } 86 } 87 88 public String getDescription() { 89 String type = ""; 90 if (!right) type = "left "; 91 if (!left) type = "right "; 92 if (!left && !right) type = "no-"; 93 return type + "trim instruction"; 94 } 95 96 boolean isIgnorable() { 97 return true; 98 } 99 } 100 | Popular Tags |