1 22 23 package org.cofax; 24 25 47 48 public abstract class TemplateLoader { 49 50 private String defaultIndex = ""; 51 52 private String defaultObject = ""; 53 54 private String templateRoot = ""; 55 56 private String templateSearch = ""; 57 58 private int templateMode = 0; 59 60 private int templateSearchLimit = 0; 61 62 72 public void init(String defaultIndex, String defaultObject, String templateRoot, int templateSwitch, int templateSearchLimit) { 73 this.defaultIndex = defaultIndex; 74 this.defaultObject = defaultObject; 75 this.templateRoot = templateRoot; 76 this.templateSearchLimit = templateSearchLimit; 77 } 78 79 84 public int getTemplateMode() { 85 return templateMode; 86 } 87 88 94 public void setTemplateMode(int templateMode) { 95 this.templateMode = templateMode; 96 } 97 98 103 public int getTemplateSearchLimit() { 104 return templateSearchLimit; 105 } 106 107 113 public void setTemplateSearchLimit(int templateSearchLimit) { 114 this.templateSearchLimit = templateSearchLimit; 115 } 116 117 122 public String getTemplateRoot() { 123 return templateRoot; 124 } 125 126 132 public void setTemplateRoot(String templateRoot) { 133 this.templateRoot = templateRoot; 134 } 135 136 141 public String getDefaultIndex() { 142 return defaultIndex; 143 } 144 145 151 public void setDefaultIndex(String defaultIndex) { 152 this.defaultIndex = defaultIndex; 153 } 154 155 160 public String getDefaultObject() { 161 return defaultObject; 162 } 163 164 170 public void setDefaultObject(String defaultObject) { 171 this.defaultObject = defaultObject; 172 } 173 174 179 public String getTemplateSearch() { 180 return templateSearch; 181 } 182 183 189 public void setTemplateSearch(String templateSearch) { 190 this.templateSearch = templateSearch; 191 } 192 193 public String toString() { 194 return "Instance Of: " + getClass().getName() + "\n" + "defaultIndex: " + defaultIndex + "\n" + "defaultObject: " + defaultObject + "\n" 195 + "templateRoot: " + templateRoot + "\n" + "templateMode: " + templateMode + "\n" + "templateSearchLimit: " + templateSearchLimit; 196 } 197 198 207 public abstract String choose(String templateFile, String overrideTemplate, String fileNameExtension); 208 209 218 public abstract String getResource(String templateId, String applicationPath); 219 220 227 public abstract CofaxPage load(String templateId); 228 229 } 230 232 | Popular Tags |