FileDocCategorySizeDatePackage
ImportTag.javaAPI DocGlassfish v2 API5190Sat May 05 19:17:56 BST 2007org.apache.taglibs.standard.tag.el.core

ImportTag

public class ImportTag extends org.apache.taglibs.standard.tag.common.core.ImportSupport

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

author
Shawn Bayern

Fields Summary
private String
context_
private String
charEncoding_
private String
url_
Constructors Summary
public ImportTag()
Constructs a new ImportTag. 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.
         */

	url = (String) ExpressionUtil.evalNotNull(
	    "import", "url", url_, String.class, this, pageContext);
	if (url == null || url.equals(""))
	    throw new NullAttributeException("import", "url");

	context = (String) ExpressionUtil.evalNotNull(
	    "import", "context", context_, String.class, this, pageContext);
	charEncoding = (String) ExpressionUtil.evalNotNull(
	    "import", "charEncoding", charEncoding_, String.class, this,
	    pageContext);
    
private voidinit()

        // null implies "no expression"
	url_ = context_ = charEncoding_ = null;
    
public voidrelease()

        super.release();
        init();
    
public voidsetCharEncoding(java.lang.String charEncoding_)

        this.charEncoding_ = charEncoding_;
    
public voidsetContext(java.lang.String context_)

        this.context_ = context_;
    
public voidsetUrl(java.lang.String url_)

        this.url_ = url_;