1 package org.jahia.clipbuilder.html.web.html.Impl.HTMLParser; 2 import java.util.*; 3 4 import org.jahia.clipbuilder.html.bean.*; 5 import org.jahia.clipbuilder.html.web.html.*; 6 7 12 public class HTMLParserDocument implements HTMLDocument { 13 14 private UrlBean urlBean; 15 private String originalHtml; 16 private String transformedDocument; 17 private String chewDocument; 18 private String documentWhithLabel; 19 private List framesList; 20 private HTMLParserTransformer transformer; 21 private String userDocument; 22 private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(HTMLParserDocument.class); 23 24 25 31 public HTMLParserDocument(UrlBean urlBean, String originalHtml) { 32 setUrlBean(urlBean); 33 this.originalHtml = originalHtml; 34 } 35 36 37 42 public void setUrlBean(UrlBean urlBean) { 43 this.urlBean = urlBean; 44 } 45 46 47 52 public void setTransformer(HTMLParserTransformer transformer) { 53 this.transformer = transformer; 54 } 55 56 57 62 public void setTransformedDocument(String transformedDocument) { 63 this.transformedDocument = transformedDocument; 64 } 65 66 67 72 public void setChewDocument(String chewDocument) { 73 this.chewDocument = chewDocument; 74 } 75 76 77 82 public void setDocumentWhithLabel(String documentWhithLabel) { 83 this.documentWhithLabel = documentWhithLabel; 84 } 85 86 87 92 public void setUserDocument(String userDocument) { 93 this.userDocument = userDocument; 94 } 95 96 97 102 public void setFramesList(List framesList) { 103 this.framesList = framesList; 104 } 105 106 107 108 114 public String getChewDocumentAsString(String tagName) { 115 getTransformer().buildChewDocument(tagName); 116 return getDocumentAsString(getChewDocument()); 117 } 118 119 120 126 public String getDocumentWhithParamLabelAsString() { 127 if (getDocumentWhithLabel() == null) { 128 getTransformer().buildDocumentWhithLabel(); 129 } 130 return getDocumentAsString(getDocumentWhithLabel()); 131 } 132 133 134 139 public String getUserDocumentAsString() { 140 if (getUserDocument() == null) { 141 getTransformer().buildUserDocument(); 142 } 143 return getDocumentAsString(getUserDocument()); 144 } 145 146 147 148 153 public String getOriginalDocumentAsString() { 154 return originalHtml; 155 } 156 157 158 159 164 public java.util.List getTransformationErrors() { 165 return getTransformer().getLastParsingErrors(); 166 } 167 168 169 170 175 public HTMLTransformer getTransformer() { 176 return this.transformer; 177 } 178 179 180 185 public String getTransformedDocument() { 186 return transformedDocument; 187 } 188 189 190 195 public String getChewDocument() { 196 return this.chewDocument; 197 } 198 199 200 205 public String getDocumentWhithLabel() { 206 return documentWhithLabel; 207 } 208 209 210 215 public String getTransformedDocumentAsString() { 216 if (getTransformedDocument() == null) { 217 getTransformer().buildTransformedDocument(); 218 } 219 return getDocumentAsString(getTransformedDocument()); 220 } 221 222 223 224 229 public UrlBean getUrlBean() { 230 return this.urlBean; 231 } 232 233 234 239 public String getUserDocument() { 240 return userDocument; 241 } 242 243 244 245 246 247 252 public List getFramesList() { 253 return framesList; 254 } 255 256 257 263 private String getDocumentAsString(String html) { 264 return html; 265 } 266 267 } 268 | Popular Tags |