1 52 53 package freemarker.core; 54 55 import java.io.IOException ; 56 57 import freemarker.debug.impl.DebuggerService; 58 import freemarker.template.TemplateException; 59 60 64 public class DebugBreak extends TemplateElement 65 { 66 public DebugBreak(TemplateElement nestedBlock) 67 { 68 this.nestedBlock = nestedBlock; 69 nestedBlock.parent = this; 70 copyLocationFrom(nestedBlock); 71 } 72 73 protected void accept(Environment env) throws TemplateException, IOException 74 { 75 if(!DebuggerService.suspendEnvironment(env, nestedBlock.getBeginLine())) 76 { 77 nestedBlock.accept(env); 78 } 79 else 80 { 81 throw new StopException(env, "Stopped by debugger"); 82 } 83 } 84 85 public String getDescription() 86 { 87 return nestedBlock.getDescription(); 88 } 89 90 public String getCanonicalForm() 91 { 92 return nestedBlock.getCanonicalForm(); 93 } 94 } 95 | Popular Tags |