当前位置: 首页>>代码示例>>Java>>正文


Java TagPluginContext.dontUseTagPlugin方法代码示例

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


在下文中一共展示了TagPluginContext.dontUseTagPlugin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例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:nkasvosve,项目名称:beyondj,代码行数:27,代码来源:When.java

示例4: doTag

import org.apache.jasper.compiler.tagplugin.TagPluginContext; //导入方法依赖的package包/类
@Override
public void doTag(TagPluginContext ctxt) {
    
    String index = null;
    
    boolean hasVarStatus = ctxt.isAttributeSpecified("varStatus");
    if (hasVarStatus) {
        ctxt.dontUseTagPlugin();
        return;
    }
    
    hasVar = ctxt.isAttributeSpecified("var");
    hasBegin = ctxt.isAttributeSpecified("begin");
    hasEnd = ctxt.isAttributeSpecified("end");
    hasStep = ctxt.isAttributeSpecified("step");
    
    boolean hasItems = ctxt.isAttributeSpecified("items");
    if (hasItems) {
        doCollection(ctxt);
        return;
    }
    
    // We must have a begin and end attributes
    index = ctxt.getTemporaryVariableName();
    ctxt.generateJavaSource("for (int " + index + " = ");
    ctxt.generateAttribute("begin");
    ctxt.generateJavaSource("; " + index + " <= ");
    ctxt.generateAttribute("end");
    if (hasStep) {
        ctxt.generateJavaSource("; " + index + "+=");
        ctxt.generateAttribute("step");
        ctxt.generateJavaSource(") {");
    }
    else {
        ctxt.generateJavaSource("; " + index + "++) {");
    }
    
    // If var is specified and the body contains an EL, then sycn
    // the var attribute
    if (hasVar /* && ctxt.hasEL() */) {
        ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
        ctxt.generateAttribute("var");
        ctxt.generateJavaSource(", String.valueOf(" + index + "));");
    }
    ctxt.generateBody();
    ctxt.generateJavaSource("}");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:48,代码来源:ForEach.java

示例5: doTag

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

	String index = null;

	boolean hasVarStatus = ctxt.isAttributeSpecified("varStatus");
	if (hasVarStatus) {
		ctxt.dontUseTagPlugin();
		return;
	}

	hasVar = ctxt.isAttributeSpecified("var");
	hasBegin = ctxt.isAttributeSpecified("begin");
	hasEnd = ctxt.isAttributeSpecified("end");
	hasStep = ctxt.isAttributeSpecified("step");

	boolean hasItems = ctxt.isAttributeSpecified("items");
	if (hasItems) {
		doCollection(ctxt);
		return;
	}

	// We must have a begin and end attributes
	index = ctxt.getTemporaryVariableName();
	ctxt.generateJavaSource("for (int " + index + " = ");
	ctxt.generateAttribute("begin");
	ctxt.generateJavaSource("; " + index + " <= ");
	ctxt.generateAttribute("end");
	if (hasStep) {
		ctxt.generateJavaSource("; " + index + "+=");
		ctxt.generateAttribute("step");
		ctxt.generateJavaSource(") {");
	} else {
		ctxt.generateJavaSource("; " + index + "++) {");
	}

	// If var is specified and the body contains an EL, then sycn
	// the var attribute
	if (hasVar /* && ctxt.hasEL() */) {
		ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
		ctxt.generateAttribute("var");
		ctxt.generateJavaSource(", String.valueOf(" + index + "));");
	}
	ctxt.generateBody();
	ctxt.generateJavaSource("}");
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:47,代码来源:ForEach.java

示例6: doTag

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

    String index = null;

    boolean hasVarStatus = ctxt.isAttributeSpecified("varStatus");
    if (hasVarStatus) {
        ctxt.dontUseTagPlugin();
        return;
    }

    hasVar = ctxt.isAttributeSpecified("var");
    hasBegin = ctxt.isAttributeSpecified("begin");
    hasEnd = ctxt.isAttributeSpecified("end");
    hasStep = ctxt.isAttributeSpecified("step");

    boolean hasItems = ctxt.isAttributeSpecified("items");
    if (hasItems) {
        doCollection(ctxt);
        return;
    }

    // We must have a begin and end attributes
    index = ctxt.getTemporaryVariableName();
    ctxt.generateJavaSource("for (int " + index + " = ");
    ctxt.generateAttribute("begin");
    ctxt.generateJavaSource("; " + index + " <= ");
    ctxt.generateAttribute("end");
    if (hasStep) {
        ctxt.generateJavaSource("; " + index + "+=");
        ctxt.generateAttribute("step");
        ctxt.generateJavaSource(") {");
    }
    else {
        ctxt.generateJavaSource("; " + index + "++) {");
    }

    // If var is specified and the body contains an EL, then sycn
    // the var attribute
    if (hasVar /* && ctxt.hasEL() */) {
        ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
        ctxt.generateAttribute("var");
        ctxt.generateJavaSource(", String.valueOf(" + index + "));");
    }
    ctxt.generateBody();
    ctxt.generateJavaSource("}");
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:48,代码来源:ForEach.java


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