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


Java EvaluationContext类代码示例

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


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

示例1: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
public Object getValue(EvaluationContext ctx)
        throws ELException {
    Object obj = this.children[0].getValue(ctx);
    if (obj == null) {
        return Boolean.TRUE;
    } else if (obj instanceof String) {
        return Boolean.valueOf(((String) obj).length() == 0);
    } else if (obj instanceof Object[]) {
        return Boolean.valueOf(((Object[]) obj).length == 0);
    } else if (obj instanceof Collection) {
        return Boolean.valueOf(((Collection) obj).isEmpty());
    } else if (obj instanceof Map) {
        return Boolean.valueOf(((Map) obj).isEmpty());
    }
    return Boolean.FALSE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AstEmpty.java

示例2: getType

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
public Class getType(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    return m.getReturnType();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AstFunction.java

示例3: isReadOnly

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
	VariableMapper varMapper = ctx.getVariableMapper();
	if (varMapper != null) {
		ValueExpression expr = varMapper.resolveVariable(this.image);
		if (expr != null) {
			return expr.isReadOnly(ctx.getELContext());
		}
	}
	ctx.setPropertyResolved(false);
	boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
	if (!ctx.isPropertyResolved()) {
		throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled.null", this.image));
	}
	return result;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:AstIdentifier.java

示例4: getType

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Class<?> getType(EvaluationContext ctx)
        throws ELException {
    
    FunctionMapper fnMapper = ctx.getFunctionMapper();
    
    // quickly validate again for this request
    if (fnMapper == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.null"));
    }
    Method m = fnMapper.resolveFunction(this.prefix, this.localName);
    if (m == null) {
        throw new ELException(MessageFactory.get("error.fnMapper.method",
                this.getOutputName()));
    }
    return m.getReturnType();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:18,代码来源:AstFunction.java

示例5: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    Object obj = this.children[0].getValue(ctx);
    if (obj == null) {
        return Boolean.TRUE;
    } else if (obj instanceof String) {
        return Boolean.valueOf(((String) obj).length() == 0);
    } else if (obj instanceof Object[]) {
        return Boolean.valueOf(((Object[]) obj).length == 0);
    } else if (obj instanceof Collection<?>) {
        return Boolean.valueOf(((Collection<?>) obj).isEmpty());
    } else if (obj instanceof Map<?,?>) {
        return Boolean.valueOf(((Map<?,?>) obj).isEmpty());
    }
    return Boolean.FALSE;
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:18,代码来源:AstEmpty.java

示例6: getType

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Class<?> getType(EvaluationContext ctx) throws ELException {
    VariableMapper varMapper = ctx.getVariableMapper();
    if (varMapper != null) {
        ValueExpression expr = varMapper.resolveVariable(this.image);
        if (expr != null) {
            return expr.getType(ctx.getELContext());
        }
    }
    ctx.setPropertyResolved(false);
    Class<?> result = ctx.getELResolver().getType(ctx, null, this.image);
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled.null", this.image));
    }
    return result;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:18,代码来源:AstIdentifier.java

示例7: isReadOnly

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public boolean isReadOnly(EvaluationContext ctx) throws ELException {
    VariableMapper varMapper = ctx.getVariableMapper();
    if (varMapper != null) {
        ValueExpression expr = varMapper.resolveVariable(this.image);
        if (expr != null) {
            return expr.isReadOnly(ctx.getELContext());
        }
    }
    ctx.setPropertyResolved(false);
    boolean result = ctx.getELResolver().isReadOnly(ctx, null, this.image);
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled.null", this.image));
    }
    return result;
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:18,代码来源:AstIdentifier.java

示例8: getValueReference

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public ValueReference getValueReference(EvaluationContext ctx) {
    VariableMapper varMapper = ctx.getVariableMapper();

    if (varMapper == null) {
        return null;
    }

    ValueExpression expr = varMapper.resolveVariable(this.image);

    if (expr == null) {
        return null;
    }

    return expr.getValueReference(ctx);
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:17,代码来源:AstIdentifier.java

示例9: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
    VariableMapper varMapper = ctx.getVariableMapper();
    if (varMapper != null) {
        ValueExpression expr = varMapper.resolveVariable(this.image);
        if (expr != null) {
            return expr.getValue(ctx.getELContext());
        }
    }
    ctx.setPropertyResolved(false);
    Object result = ctx.getELResolver().getValue(ctx, null, this.image);
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled.null", this.image));
    }
    return result;
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:18,代码来源:AstIdentifier.java

示例10: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    StringBuilder sb = new StringBuilder(16);
    Object obj = null;
    if (this.children != null) {
        for (int i = 0; i < this.children.length; i++) {
            obj = this.children[i].getValue(ctx);
            if (obj != null) {
                sb.append(ELSupport.coerceToString(obj));
            }
        }
    }
    return sb.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:AstCompositeExpression.java

示例11: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    Object obj0 = this.children[0].getValue(ctx);
    Object obj1 = this.children[1].getValue(ctx);
    if (obj0 == obj1) {
        return Boolean.TRUE;
    }
    if (obj0 == null || obj1 == null) {
        return Boolean.FALSE;
    }
    return (compare(obj0, obj1) <= 0) ? Boolean.TRUE : Boolean.FALSE;
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:14,代码来源:AstLessThanEqual.java

示例12: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    Object obj = this.children[0].getValue(ctx);
    Boolean b = coerceToBoolean(obj);
    if (b.booleanValue()) {
        return b;
    }
    obj = this.children[1].getValue(ctx);
    b = coerceToBoolean(obj);
    return b;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:AstOr.java

示例13: getValue

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
@Override
public Object getValue(EvaluationContext ctx)
        throws ELException {
    Object obj = this.children[0].getValue(ctx);
    Boolean b = coerceToBoolean(obj);
    return Boolean.valueOf(!b.booleanValue());
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:AstNot.java

示例14: getParameterTypes

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
public Class<?>[] getParameterTypes(EvaluationContext ctx) {
    ArrayList<Class<?>> paramTypes = new ArrayList<Class<?>>();
    for (int i = 0; i < this.jjtGetNumChildren(); i++) {
        paramTypes.add(this.jjtGetChild(i).getType(ctx));
    }
    return paramTypes.toArray(new Class<?>[paramTypes.size()]);
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:8,代码来源:AstMethodParameters.java

示例15: getParameters

import org.apache.el.lang.EvaluationContext; //导入依赖的package包/类
public Object[] getParameters(EvaluationContext ctx) {
	ArrayList<Object> params = new ArrayList<Object>();
	for (int i = 0; i < this.jjtGetNumChildren(); i++) {
		params.add(this.jjtGetChild(i).getValue(ctx));
	}
	return params.toArray(new Object[params.size()]);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:AstMethodParameters.java


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