1 19 20 package com.sslexplorer.core; 21 22 36 37 public class CoreScript { 38 39 42 public final static int PAGE_HEADER = 0; 43 44 47 public final static int AFTER_BODY_START = 1; 48 49 52 public final static int BEFORE_BODY_END = 2; 53 54 56 private String language; 57 private String path; 58 private String script; 59 private String type; 60 private int position; 61 62 71 public CoreScript(String language, String path, String script, String type) { 72 this(AFTER_BODY_START, language, path, script, type); 73 } 74 75 85 public CoreScript(int position, String language, String path, String script, String type) { 86 super(); 87 this.position = position; 88 this.language = language; 89 this.path = path; 90 this.script = script; 91 this.type = type; 92 } 93 94 100 public String getLanguage() { 101 return language; 102 } 103 104 110 public void setLanguage(String language) { 111 this.language = language; 112 } 113 114 119 public String getPath() { 120 return path; 121 } 122 123 128 public void setPath(String path) { 129 this.path = path; 130 } 131 132 137 public String getScript() { 138 return script; 139 } 140 141 146 public void setScript(String script) { 147 this.script = script; 148 } 149 150 155 public String getType() { 156 return type; 157 } 158 159 164 public void setType(String type) { 165 this.type = type; 166 } 167 168 173 public String getRenderedHTML() { 174 StringBuffer buf = new StringBuffer (); 175 buf.append("<script"); 176 if(language != null && !language.equals("")) { 177 buf.append(" language=\""); 178 buf.append(language); 179 buf.append("\""); 180 } 181 if(type != null && !type.equals("")) { 182 buf.append(" language=\""); 183 buf.append(language); 184 buf.append("\""); 185 } 186 if(path != null && !path.equals("")) { 187 buf.append(" SRC=\""); 188 buf.append(path); 189 buf.append("\""); 190 } 191 if(script != null && !script.equals("")) { 192 buf.append(">"); 193 buf.append(script); 194 buf.append("</script>"); 195 } 196 else { 197 buf.append("/>"); 198 } 199 return buf.toString(); 200 } 201 202 208 public int getPosition() { 209 return position; 210 } 211 212 218 public void setPosition(int position) { 219 this.position = position; 220 } 221 } 222 | Popular Tags |