• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TagPluginContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.jasper.compiler.tagplugin.TagPluginContext的典型用法代码示例。如果您正苦于以下问题:Java TagPluginContext类的具体用法?Java TagPluginContext怎么用?Java TagPluginContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TagPluginContext类属于org.apache.jasper.compiler.tagplugin包,在下文中一共展示了TagPluginContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    String condV = ctxt.getTemporaryVariableName();
    ctxt.generateJavaSource("boolean " + condV + "=");
    ctxt.generateAttribute("test");
    ctxt.generateJavaSource(";");
    if (ctxt.isAttributeSpecified("var")) {
        String scope = "PageContext.PAGE_SCOPE";
        if (ctxt.isAttributeSpecified("scope")) {
            String scopeStr = ctxt.getConstantAttribute("scope");
            if ("request".equals(scopeStr)) {
                scope = "PageContext.REQUEST_SCOPE";
            } else if ("session".equals(scopeStr)) {
                scope = "PageContext.SESSION_SCOPE";
            } else if ("application".equals(scopeStr)) {
                scope = "PageContext.APPLICATION_SCOPE";
            }
        }
        ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
        ctxt.generateAttribute("var");
        ctxt.generateJavaSource(", new Boolean(" + condV + ")," + scope + ");");
    }
    ctxt.generateJavaSource("if (" + condV + "){");
    ctxt.generateBody();
    ctxt.generateJavaSource("}");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:If.java


示例2: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    
    //scope flag
    boolean hasScope = ctxt.isAttributeSpecified("scope");
    
    //the value of the "var"
    String strVar = ctxt.getConstantAttribute("var");
    
    //remove attribute from certain scope.
    //default scope is "page".
    if(hasScope){
        int iScope = Util.getScope(ctxt.getConstantAttribute("scope"));
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\"," + iScope + ");");
    }else{
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\");");
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:Remove.java


示例3: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    // Get the parent context to determine if this is the first <c:when>
    TagPluginContext parentContext = ctxt.getParentContext();
    if (parentContext == null) {
        ctxt.dontUseTagPlugin();
        return;
    }
    
    if ("true".equals(parentContext.getPluginAttribute("hasBeenHere"))) {
        ctxt.generateJavaSource("} else if(");
        // See comment below for the reason we generate the extra "}" here.
    }
    else {
        ctxt.generateJavaSource("if(");
        parentContext.setPluginAttribute("hasBeenHere", "true");
    }
    ctxt.generateAttribute("test");
    ctxt.generateJavaSource("){");
    ctxt.generateBody();
    
    // We don't generate the closing "}" for the "if" here because there
    // may be whitespaces in between <c:when>'s.  Instead we delay
    // generating it until the next <c:when> or <c:otherwise> or
    // <c:choose>
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:When.java


示例4: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
public void doTag(TagPluginContext ctxt) {
    
    //scope flag
    boolean hasScope = ctxt.isAttributeSpecified("scope");
    
    //the value of the "var"
    String strVar = ctxt.getConstantAttribute("var");
    
    //remove attribute from certain scope.
    //default scope is "page".
    if(hasScope){
        int iScope = Util.getScope(ctxt.getConstantAttribute("scope"));
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\"," + iScope + ");");
    }else{
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\");");
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:Remove.java


示例5: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
	String condV = ctxt.getTemporaryVariableName();
	ctxt.generateJavaSource("boolean " + condV + "=");
	ctxt.generateAttribute("test");
	ctxt.generateJavaSource(";");
	if (ctxt.isAttributeSpecified("var")) {
		String scope = "PageContext.PAGE_SCOPE";
		if (ctxt.isAttributeSpecified("scope")) {
			String scopeStr = ctxt.getConstantAttribute("scope");
			if ("request".equals(scopeStr)) {
				scope = "PageContext.REQUEST_SCOPE";
			} else if ("session".equals(scopeStr)) {
				scope = "PageContext.SESSION_SCOPE";
			} else if ("application".equals(scopeStr)) {
				scope = "PageContext.APPLICATION_SCOPE";
			}
		}
		ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
		ctxt.generateAttribute("var");
		ctxt.generateJavaSource(", new Boolean(" + condV + ")," + scope + ");");
	}
	ctxt.generateJavaSource("if (" + condV + "){");
	ctxt.generateBody();
	ctxt.generateJavaSource("}");
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:27,代码来源:If.java


示例6: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {

	// scope flag
	boolean hasScope = ctxt.isAttributeSpecified("scope");

	// the value of the "var"
	String strVar = ctxt.getConstantAttribute("var");

	// remove attribute from certain scope.
	// default scope is "page".
	if (hasScope) {
		int iScope = Util.getScope(ctxt.getConstantAttribute("scope"));
		ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\"," + iScope + ");");
	} else {
		ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\");");
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:19,代码来源:Remove.java


示例7: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
	// Get the parent context to determine if this is the first <c:when>
	TagPluginContext parentContext = ctxt.getParentContext();
	if (parentContext == null) {
		ctxt.dontUseTagPlugin();
		return;
	}

	if ("true".equals(parentContext.getPluginAttribute("hasBeenHere"))) {
		ctxt.generateJavaSource("} else if(");
		// See comment below for the reason we generate the extra "}" here.
	} else {
		ctxt.generateJavaSource("if(");
		parentContext.setPluginAttribute("hasBeenHere", "true");
	}
	ctxt.generateAttribute("test");
	ctxt.generateJavaSource("){");
	ctxt.generateBody();

	// We don't generate the closing "}" for the "if" here because there
	// may be whitespaces in between <c:when>'s. Instead we delay
	// generating it until the next <c:when> or <c:otherwise> or
	// <c:choose>
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:When.java


示例8: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {

    //scope flag
    boolean hasScope = ctxt.isAttributeSpecified("scope");

    //the value of the "var"
    String strVar = ctxt.getConstantAttribute("var");

    //remove attribute from certain scope.
    //default scope is "page".
    if(hasScope){
        int iScope = Util.getScope(ctxt.getConstantAttribute("scope"));
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\"," + iScope + ");");
    }else{
        ctxt.generateJavaSource("pageContext.removeAttribute(\"" + strVar + "\");");
    }
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:19,代码来源:Remove.java


示例9: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    // Get the parent context to determine if this is the first <c:when>
    TagPluginContext parentContext = ctxt.getParentContext();
    if (parentContext == null) {
        ctxt.dontUseTagPlugin();
        return;
    }

    if ("true".equals(parentContext.getPluginAttribute("hasBeenHere"))) {
        ctxt.generateJavaSource("} else if(");
        // See comment below for the reason we generate the extra "}" here.
    }
    else {
        ctxt.generateJavaSource("if(");
        parentContext.setPluginAttribute("hasBeenHere", "true");
    }
    ctxt.generateAttribute("test");
    ctxt.generateJavaSource("){");
    ctxt.generateBody();

    // We don't generate the closing "}" for the "if" here because there
    // may be whitespaces in between <c:when>'s.  Instead we delay
    // generating it until the next <c:when> or <c:otherwise> or
    // <c:choose>
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:27,代码来源:When.java


示例10: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    
    // See When.java for the reason whey "}" is need at the beginng and
    // not at the end.
    ctxt.generateJavaSource("} else {");
    ctxt.generateBody();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:9,代码来源:Otherwise.java


示例11: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    
    // Not much to do here, much of the work will be done in the
    // containing tags, <c:when> and <c:otherwise>.
    
    ctxt.generateBody();
    // See comments in When.java for the reason "}" is generated here.
    ctxt.generateJavaSource("}");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:Choose.java


示例12: invokePlugin

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
/**
 * Invoke tag plugin for the given custom tag, if a plugin exists for
 * the custom tag's tag handler.
 *
 * The given custom tag node will be manipulated by the plugin.
 */
private void invokePlugin(Node.CustomTag n, PageInfo pageInfo) {
    TagPlugin tagPlugin = tagPlugins.get(n.getTagHandlerClass().getName());
    if (tagPlugin == null) {
        return;
    }

    TagPluginContext tagPluginContext = new TagPluginContextImpl(n, pageInfo);
    n.setTagPluginContext(tagPluginContext);
    tagPlugin.doTag(tagPluginContext);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:17,代码来源:TagPluginManager.java


示例13: getParentContext

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public TagPluginContext getParentContext() {
    Node parent = node.getParent();
    if (! (parent instanceof Node.CustomTag)) {
        return null;
    }
    return ((Node.CustomTag) parent).getTagPluginContext();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:9,代码来源:TagPluginManager.java


示例14: invokePlugin

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
/**
    * Invoke tag plugin for the given custom tag, if a plugin exists for 
    * the custom tag's tag handler.
    *
    * The given custom tag node will be manipulated by the plugin.
    */
   private void invokePlugin(Node.CustomTag n) {
TagPlugin tagPlugin = (TagPlugin)
	tagPlugins.get(n.getTagHandlerClass().getName());
if (tagPlugin == null) {
    return;
}

TagPluginContext tagPluginContext = new TagPluginContextImpl(n, pageInfo);
n.setTagPluginContext(tagPluginContext);
tagPlugin.doTag(tagPluginContext);
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:TagPluginManager.java


示例15: getParentContext

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
public TagPluginContext getParentContext() {
    Node parent = node.getParent();
    if (! (parent instanceof Node.CustomTag)) {
	return null;
    }
    return ((Node.CustomTag) parent).getTagPluginContext();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:TagPluginManager.java


示例16: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {

	// See When.java for the reason whey "}" is need at the beginning and
	// not at the end.
	ctxt.generateJavaSource("} else {");
	ctxt.generateBody();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:Otherwise.java


示例17: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {

	// Not much to do here, much of the work will be done in the
	// containing tags, <c:when> and <c:otherwise>.

	ctxt.generateBody();
	// See comments in When.java for the reason "}" is generated here.
	ctxt.generateJavaSource("}");
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:Choose.java


示例18: invokePlugin

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
/**
 * Invoke tag plugin for the given custom tag, if a plugin exists for the
 * custom tag's tag handler.
 *
 * The given custom tag node will be manipulated by the plugin.
 */
private void invokePlugin(Node.CustomTag n, PageInfo pageInfo) {
	TagPlugin tagPlugin = tagPlugins.get(n.getTagHandlerClass().getName());
	if (tagPlugin == null) {
		return;
	}

	TagPluginContext tagPluginContext = new TagPluginContextImpl(n, pageInfo);
	n.setTagPluginContext(tagPluginContext);
	tagPlugin.doTag(tagPluginContext);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:TagPluginManager.java


示例19: getParentContext

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public TagPluginContext getParentContext() {
	Node parent = node.getParent();
	if (!(parent instanceof Node.CustomTag)) {
		return null;
	}
	return ((Node.CustomTag) parent).getTagPluginContext();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:TagPluginManager.java


示例20: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {

    // See When.java for the reason whey "}" is need at the beginng and
    // not at the end.
    ctxt.generateJavaSource("} else {");
    ctxt.generateBody();
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:9,代码来源:Otherwise.java



注:本文中的org.apache.jasper.compiler.tagplugin.TagPluginContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XImportSection类代码示例发布时间:2022-05-22
下一篇:
Java SmartImageView类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap