1 package org.apache.turbine.tool; 2 3 56 57 import org.apache.turbine.DynamicURI; 58 import org.apache.turbine.RunData; 59 import org.apache.turbine.services.pull.ApplicationTool; 60 61 77 public class TemplateLink 78 extends DynamicURI 79 implements ApplicationTool 80 { 81 82 public static final String TEMPLATE_KEY = "template"; 83 84 85 private String template = null; 86 87 92 public TemplateLink() 93 { 94 } 95 96 101 public TemplateLink(RunData data) 102 { 103 super(data); 104 } 105 106 113 public void init(Object data) 114 { 115 super.init((RunData)data); 119 } 120 121 124 public void refresh() 125 { 126 } 128 129 133 public TemplateLink setEncodeURLOff() 134 { 135 setEncodeUrl(false); 136 return this; 137 } 138 139 145 public TemplateLink setPage(String t) 146 { 147 template = t; 148 addPathInfo(TEMPLATE_KEY,t); 149 return this; 150 } 151 152 158 public String getPage() 159 { 160 return template; 161 } 162 163 170 public TemplateLink setAbsolute(boolean b) 171 { 172 setRelative(!b); 173 return this; 174 } 175 176 183 public String toString() 184 { 185 String output = super.toString(); 186 187 removePathInfo(); 190 removeQueryData(); 191 setEncodeUrl(true); 192 setAbsolute(true); 193 194 return output; 195 } 196 197 205 public String getURI() 206 { 207 return super.toString(); 208 } 209 } 210 | Popular Tags |