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


Java ELResolver.getType方法代码示例

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


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

示例1: setValue

import javax.el.ELResolver; //导入方法依赖的package包/类
@Override
public void setValue(EvaluationContext ctx, Object value)
        throws ELException {
    Target t = getTarget(ctx);
    ctx.setPropertyResolved(false);
    ELResolver resolver = ctx.getELResolver();

    // coerce to the expected type
    Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
    if (COERCE_TO_ZERO == true
            || !isAssignable(value, targetClass)) {
        resolver.setValue(ctx, t.base, t.property,
                ELSupport.coerceToType(value, targetClass));
    } else {
        resolver.setValue(ctx, t.base, t.property, value);
    }
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled", t.base, t.property));            
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:AstValue.java

示例2: setValue

import javax.el.ELResolver; //导入方法依赖的package包/类
@Override
public void setValue(EvaluationContext ctx, Object value) throws ELException {
	Target t = getTarget(ctx);
	ctx.setPropertyResolved(false);
	ELResolver resolver = ctx.getELResolver();

	// coerce to the expected type
	Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
	if (COERCE_TO_ZERO == true || !isAssignable(value, targetClass)) {
		resolver.setValue(ctx, t.base, t.property, ELSupport.coerceToType(value, targetClass));
	} else {
		resolver.setValue(ctx, t.base, t.property, value);
	}
	if (!ctx.isPropertyResolved()) {
		throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled", t.base, t.property));
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:18,代码来源:AstValue.java

示例3: setValue

import javax.el.ELResolver; //导入方法依赖的package包/类
public void setValue(EvaluationContext ctx, Object value)
        throws ELException {
    Target t = getTarget(ctx);
    ctx.setPropertyResolved(false);
    ELResolver resolver = ctx.getELResolver();
    // coerce to the expected type
    Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
    if (COERCE_TO_ZERO
            || !isAssignable(value, targetClass)) {
        value = ELSupport.coerceToType(value, targetClass);
    }
    resolver.setValue(ctx, t.base, t.property, value);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AstValue.java

示例4: getType

import javax.el.ELResolver; //导入方法依赖的package包/类
public Class getType(Object base, EvaluationContext ctx) throws ELException {
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	return resolver.getType(ctx, base, this.image);
}
 
开发者ID:seam2,项目名称:jboss-el,代码行数:6,代码来源:AstPropertySuffix.java

示例5: getType

import javax.el.ELResolver; //导入方法依赖的package包/类
public Class getType(Object base, EvaluationContext ctx) throws ELException {
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	return resolver.getType(ctx, base, this.getValue(ctx));
}
 
开发者ID:seam2,项目名称:jboss-el,代码行数:6,代码来源:AstBracketSuffix.java


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