1 52 53 package freemarker.core; 54 55 import freemarker.template.*; 56 import freemarker.template.utility.StandardCompress; 57 import java.io.*; 58 59 65 final class CompressedBlock extends TemplateElement { 66 67 CompressedBlock(TemplateElement nestedBlock) { 68 this.nestedBlock = nestedBlock; 69 } 70 71 void accept(Environment env) throws TemplateException, IOException { 72 if (nestedBlock != null) { 73 env.visit(nestedBlock, StandardCompress.INSTANCE, null); 74 } 75 } 76 77 public String getCanonicalForm() { 78 String nested = nestedBlock != null ? nestedBlock.getCanonicalForm() : ""; 79 return "<#compress>" + nested + "</#compress>"; 80 } 81 82 public String getDescription() { 83 return "compressed block"; 84 } 85 86 boolean isIgnorable() { 87 return nestedBlock == null || nestedBlock.isIgnorable(); 88 } 89 } 90 91 | Popular Tags |