本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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());
}
示例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()]);
}
示例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()]);
}