FileDocCategorySizeDatePackage
ParseTag.javaAPI DocGlassfish v2 API5251Sat May 05 19:17:58 BST 2007org.apache.taglibs.standard.tag.el.xml

ParseTag

public class ParseTag extends org.apache.taglibs.standard.tag.common.xml.ParseSupport

A handler for <parse> that accepts attributes as Strings and evaluates them as expressions at runtime.

author
Shawn Bayern

Fields Summary
private String
xml_
private String
systemId_
private String
filter_
Constructors Summary
public ParseTag()
Constructs a new ParseTag. As with TagSupport, subclasses should not provide other constructors and are expected to call the superclass constructor

        super();
        init();
    
Methods Summary
public intdoStartTag()


        // evaluate any expressions we were passed, once per invocation
        evaluateExpressions();

	// chain to the parent implementation
	return super.doStartTag();
    
private voidevaluateExpressions()

        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

	xml = ExpressionUtil.evalNotNull(
	    "parse", "xml", xml_, Object.class, this, pageContext);
	systemId = (String) ExpressionUtil.evalNotNull(
	    "parse", "systemId", systemId_, String.class, this, pageContext);

	try {
	    filter = (XMLFilter) ExpressionUtil.evalNotNull(
	        "parse", "filter", filter_, XMLFilter.class, this, pageContext);
	} catch (NullAttributeException ex) {
	    // explicitly let 'filter' be null
	    filter = null;
	}
    
private voidinit()

        // null implies "no expression"
	filter_ = xml_ = systemId_ = null;
    
public voidrelease()

        super.release();
        init();
    
public voidsetFilter(java.lang.String filter_)

        this.filter_ = filter_;
    
public voidsetSystemId(java.lang.String systemId_)

        this.systemId_ = systemId_;
    
public voidsetXml(java.lang.String xml_)

        this.xml_ = xml_;