1 31 32 package org.opencms.jsp.parse; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.main.CmsException; 36 import org.opencms.util.I_CmsHtmlNodeVisitor; 37 38 import java.util.List ; 39 40 import org.htmlparser.util.ParserException; 41 42 63 public abstract class A_CmsConfiguredHtmlParser { 64 65 66 private CmsObject m_cmsObject; 67 68 69 private String m_param; 70 71 72 private I_CmsHtmlNodeVisitor m_visitor; 73 74 78 protected A_CmsConfiguredHtmlParser() { 79 80 } 82 83 93 protected abstract I_CmsHtmlNodeVisitor createVisitorInstance() throws CmsException; 94 95 107 public String doParse(String html, String encoding, List noAutoCloseTags) throws ParserException, CmsException { 108 109 m_visitor = createVisitorInstance(); 110 m_visitor.setNoAutoCloseTags(noAutoCloseTags); 111 String result = ""; 112 m_visitor.process(html, encoding); 113 result = m_visitor.getResult(); 114 if (false) { 117 throw new CmsException(null); 118 } 119 return result; 120 } 121 122 129 protected CmsObject getCmsObject() { 130 131 return m_cmsObject; 132 } 133 134 139 protected String getParam() { 140 141 return m_param; 142 } 143 144 149 protected I_CmsHtmlNodeVisitor getVisitor() { 150 151 return m_visitor; 152 } 153 154 161 public void setCmsObject(CmsObject cmsObject) { 162 163 m_cmsObject = cmsObject; 164 } 165 166 173 public void setParam(String param) { 174 175 m_param = param; 176 } 177 } | Popular Tags |