1 package org.apache.turbine.util.template; 2 3 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 22 import org.apache.ecs.ConcreteElement; 23 24 import org.apache.turbine.modules.ScreenLoader; 25 import org.apache.turbine.util.RunData; 26 27 46 public class TemplateScreen 47 { 48 49 private static Log log = LogFactory.getLog(TemplateScreen.class); 50 51 52 private RunData data; 53 54 55 private String screen; 56 57 62 public TemplateScreen(RunData data) 63 { 64 this.data = data; 65 this.screen = data.getScreen(); 66 } 67 68 74 public TemplateScreen setScreen(String screen) 75 { 76 this.screen = screen; 77 return this; 78 } 79 80 85 public String toString() 86 { 87 String returnValue = ""; 88 89 try 90 { 91 ConcreteElement results = ScreenLoader.getInstance() 92 .eval(data, this.screen); 93 94 if (results != null) 95 { 96 returnValue = results.toString(); 97 } 98 } 99 catch (Exception e) 100 { 101 log.error(e); 102 } 103 104 return returnValue; 105 } 106 } 107 | Popular Tags |