1 16 17 package org.apache.taglibs.standard.tag.el.xml; 18 19 import javax.servlet.jsp.JspException ; 20 21 import org.apache.taglibs.standard.tag.common.core.NullAttributeException; 22 import org.apache.taglibs.standard.tag.common.xml.ParseSupport; 23 import org.apache.taglibs.standard.tag.el.core.ExpressionUtil; 24 import org.xml.sax.XMLFilter ; 25 26 32 public class ParseTag extends ParseSupport { 33 34 37 private String xml_; private String systemId_; private String filter_; 41 42 45 50 public ParseTag() { 51 super(); 52 init(); 53 } 54 55 56 59 public int doStartTag() throws JspException { 61 62 evaluateExpressions(); 64 65 return super.doStartTag(); 67 } 68 69 70 public void release() { 72 super.release(); 73 init(); 74 } 75 76 77 80 public void setFilter(String filter_) { 82 this.filter_ = filter_; 83 } 84 85 public void setXml(String xml_) { 86 this.xml_ = xml_; 87 } 88 89 public void setSystemId(String systemId_) { 90 this.systemId_ = systemId_; 91 } 92 93 94 97 private void init() { 99 filter_ = xml_ = systemId_ = null; 101 } 102 103 104 private void evaluateExpressions() throws JspException { 105 112 113 xml = ExpressionUtil.evalNotNull( 114 "parse", "xml", xml_, Object .class, this, pageContext); 115 systemId = (String ) ExpressionUtil.evalNotNull( 116 "parse", "systemId", systemId_, String .class, this, pageContext); 117 118 try { 119 filter = (XMLFilter ) ExpressionUtil.evalNotNull( 120 "parse", "filter", filter_, XMLFilter .class, this, pageContext); 121 } catch (NullAttributeException ex) { 122 filter = null; 124 } 125 } 126 } 127 | Popular Tags |