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


Java JspRuntimeLibrary.getReadMethod方法代码示例

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


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

示例1: visit

import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
public void visit(Node.GetProperty n) throws JasperException {
    String name = n.getTextAttribute("name");
    String property = n.getTextAttribute("property");

    n.setBeginJavaLine(out.getJavaLine());

    if (beanInfo.checkVariable(name)) {
        // Bean is defined using useBean, introspect at compile time
        Class bean = beanInfo.getBeanType(name);
        String beanName = JspUtil.getCanonicalName(bean);
        java.lang.reflect.Method meth = JspRuntimeLibrary
                .getReadMethod(bean, property);
        String methodName = meth.getName();
        out
                .printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
                        + "((("
                        + beanName
                        + ")_jspx_page_context.findAttribute("
                        + "\""
                        + name + "\"))." + methodName + "())));");
    } else {
        // The object could be a custom action with an associated
        // VariableInfo entry for this name.
        // Get the class name and then introspect at runtime.
        out
                .printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
                        + "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
                        + "(_jspx_page_context.getAttribute(\""
                        + name
                        + "\", PageContext.PAGE_SCOPE), \""
                        + property
                        + "\")));");
    }

    n.setEndJavaLine(out.getJavaLine());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:Generator.java

示例2: visit

import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
	String name = n.getTextAttribute("name");
	String property = n.getTextAttribute("property");

	n.setBeginJavaLine(out.getJavaLine());

	if (beanInfo.checkVariable(name)) {
		// Bean is defined using useBean, introspect at compile time
		Class<?> bean = beanInfo.getBeanType(name);
		String beanName = bean.getCanonicalName();
		java.lang.reflect.Method meth = JspRuntimeLibrary.getReadMethod(bean, property);
		String methodName = meth.getName();
		out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString(" + "(((" + beanName
				+ ")_jspx_page_context.findAttribute(" + "\"" + name + "\"))." + methodName + "())));");
	} else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
		// The object is a custom action with an associated
		// VariableInfo entry for this name.
		// Get the class name and then introspect at runtime.
		out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
				+ "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
				+ "(_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\")));");
	} else {
		StringBuilder msg = new StringBuilder();
		msg.append("file:");
		msg.append(n.getStart());
		msg.append(" jsp:getProperty for bean with name '");
		msg.append(name);
		msg.append("'. Name was not previously introduced as per JSP.5.3");

		throw new JasperException(msg.toString());
	}

	n.setEndJavaLine(out.getJavaLine());
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:36,代码来源:Generator.java

示例3: visit

import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
public void visit(Node.GetProperty n) throws JasperException {
    String name = n.getTextAttribute("name");
    String property = n.getTextAttribute("property");

    n.setBeginJavaLine(out.getJavaLine());

    if (beanInfo.checkVariable(name)) {
        // Bean is defined using useBean, introspect at compile time
        Class bean = beanInfo.getBeanType(name);
        String beanName = JspUtil.getCanonicalName(bean);
        java.lang.reflect.Method meth =
            JspRuntimeLibrary.getReadMethod(bean, property);
        String methodName = meth.getName();
        out.printil(
            "out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
                + "((("
                + beanName
                + ")_jspx_page_context.findAttribute("
                + "\""
                + name
                + "\"))."
                + methodName
                + "())));");
    } else {
        // The object could be a custom action with an associated
        // VariableInfo entry for this name.
        // Get the class name and then introspect at runtime.
        out.printil(
            "out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
                + "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
                + "(_jspx_page_context.findAttribute(\""
                + name
                + "\"), \""
                + property
                + "\")));");
    }

    n.setEndJavaLine(out.getJavaLine());
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:40,代码来源:Generator.java

示例4: visit

import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
    String name = n.getTextAttribute("name");
    String property = n.getTextAttribute("property");

    n.setBeginJavaLine(out.getJavaLine());

    if (beanInfo.checkVariable(name)) {
        // Bean is defined using useBean, introspect at compile time
        Class<?> bean = beanInfo.getBeanType(name);
        String beanName = bean.getCanonicalName();
        java.lang.reflect.Method meth = JspRuntimeLibrary
                .getReadMethod(bean, property);
        String methodName = meth.getName();
        out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
                + "((("
                + beanName
                + ")_jspx_page_context.findAttribute("
                + "\""
                + name + "\"))." + methodName + "())));");
    } else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
        // The object is a custom action with an associated
        // VariableInfo entry for this name.
        // Get the class name and then introspect at runtime.
        out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
                + "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
                + "(_jspx_page_context.findAttribute(\""
                + name
                + "\"), \""
                + property
                + "\")));");
    } else {
        StringBuilder msg = new StringBuilder();
        msg.append("file:");
        msg.append(n.getStart());
        msg.append(" jsp:getProperty for bean with name '");
        msg.append(name);
        msg.append(
                "'. Name was not previously introduced as per JSP.5.3");
        
        throw new JasperException(msg.toString());
    }

    n.setEndJavaLine(out.getJavaLine());
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:46,代码来源:Generator.java

示例5: visit

import org.apache.jasper.runtime.JspRuntimeLibrary; //导入方法依赖的package包/类
@Override
public void visit(Node.GetProperty n) throws JasperException {
    String name = n.getTextAttribute("name");
    String property = n.getTextAttribute("property");

    n.setBeginJavaLine(out.getJavaLine());

    if (beanInfo.checkVariable(name)) {
        // Bean is defined using useBean, introspect at compile time
        Class<?> bean = beanInfo.getBeanType(name);
        String beanName = bean.getCanonicalName();
        java.lang.reflect.Method meth = JspRuntimeLibrary
                .getReadMethod(bean, property);
        String methodName = meth.getName();
        out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString("
                + "((("
                + beanName
                + ")_jspx_page_context.findAttribute("
                + "\""
                + name + "\"))." + methodName + "())));");
    } else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) {
        // The object is a custom action with an associated
        // VariableInfo entry for this name.
        // Get the class name and then introspect at runtime.
        out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString"
                + "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty"
                + "(_jspx_page_context.findAttribute(\""
                + name
                + "\"), \""
                + property
                + "\")));");
    } else {
        StringBuilder msg = new StringBuilder();
        msg.append("file:");
        msg.append(n.getStart());
        msg.append(" jsp:getProperty for bean with name '");
        msg.append(name);
        msg.append(
                "'. Name was not previously introduced as per JSP.5.3");

        throw new JasperException(msg.toString());
    }

    n.setEndJavaLine(out.getJavaLine());
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:46,代码来源:Generator.java


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