本文整理汇总了Java中org.activiti.engine.impl.javax.el.ELContext类的典型用法代码示例。如果您正苦于以下问题:Java ELContext类的具体用法?Java ELContext怎么用?Java ELContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ELContext类属于org.activiti.engine.impl.javax.el包,在下文中一共展示了ELContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getType
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Class<?> getType(Bindings bindings, ELContext context) {
if (!lvalue) {
return null;
}
Object base = prefix.eval(bindings, context);
if (base == null) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", prefix));
}
Object property = getProperty(bindings, context);
if (property == null && strict) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", "null", base));
}
context.setPropertyResolved(false);
Class<?> result = context.getELResolver().getType(context, base, property);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", property, base));
}
return result;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:AstProperty.java
示例2: setValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public void setValue(Bindings bindings, ELContext context, Object value) throws ELException {
if (!lvalue) {
throw new ELException(LocalMessages.get("error.value.set.rvalue", getStructuralId(bindings)));
}
Object base = prefix.eval(bindings, context);
if (base == null) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", prefix));
}
Object property = getProperty(bindings, context);
if (property == null && strict) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", "null", base));
}
context.setPropertyResolved(false);
context.getELResolver().setValue(context, base, property, value);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.property.notfound", property, base));
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:AstProperty.java
示例3: invoke
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object invoke(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes, Object[] paramValues) {
Object base = property.getPrefix().eval(bindings, context);
if (base == null) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", property.getPrefix()));
}
Object method = property.getProperty(bindings, context);
if (method == null) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.method.notfound", "null", base));
}
String name = bindings.convert(method, String.class);
paramValues = params.eval(bindings, context);
context.setPropertyResolved(false);
Object result = context.getELResolver().invoke(context, base, name, paramTypes, paramValues);
if (!context.isPropertyResolved()) {
throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, base.getClass()));
}
// if (returnType != null && !returnType.isInstance(result)) { // should we check returnType for method invocations?
// throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, base.getClass()));
// }
return result;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:AstMethod.java
示例4: getElContext
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
public ELContext getElContext(VariableScope variableScope) {
ELContext elContext = null;
if (variableScope instanceof VariableScopeImpl) {
VariableScopeImpl variableScopeImpl = (VariableScopeImpl) variableScope;
elContext = variableScopeImpl.getCachedElContext();
}
if (elContext == null) {
elContext = createElContext(variableScope);
if (variableScope instanceof VariableScopeImpl) {
((VariableScopeImpl) variableScope).setCachedElContext(elContext);
}
}
return elContext;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:ExpressionManager.java
示例5: getMethod
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
protected Method getMethod(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) {
Object value = eval(bindings, context);
if (value == null) {
throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name));
}
if (value instanceof Method) {
Method method = (Method) value;
if (returnType != null && !returnType.isAssignableFrom(method.getReturnType())) {
throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name));
}
if (!Arrays.equals(method.getParameterTypes(), paramTypes)) {
throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notfound", name));
}
return method;
}
throw new MethodNotFoundException(LocalMessages.get("error.identifier.method.notamethod", name, value.getClass()));
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:AstIdentifier.java
示例6: getValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object getValue(ELContext context, Object base, Object property) {
Object bean = Mocks.get(property);
if (bean != null) {
context.setPropertyResolved(true);
}
return bean;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:MockElResolver.java
示例7: isReadOnly
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public boolean isReadOnly(Bindings bindings, ELContext context) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
return expression.isReadOnly(context);
}
context.setPropertyResolved(false);
boolean result = context.getELResolver().isReadOnly(context, null, name);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
}
return result;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:14,代码来源:AstIdentifier.java
示例8: getValueReference
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public ValueReference getValueReference(Bindings bindings, ELContext context) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
return expression.getValueReference(context);
}
return new ValueReference(null, name);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:AstIdentifier.java
示例9: getValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object getValue(ELContext context, Object base, Object property) {
if (base == null) {
if (wrappedMap.containsKey(property)) {
context.setPropertyResolved(true);
return wrappedMap.get(property);
}
}
return null;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:11,代码来源:ReadOnlyMapELResolver.java
示例10: setValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base == null) {
String variable = (String) property;
if (variableScope.hasVariable(variable)) {
variableScope.setVariable(variable, value);
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:VariableScopeElResolver.java
示例11: setValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public void setValue(Bindings bindings, ELContext context, Object value) {
ValueExpression expression = bindings.getVariable(index);
if (expression != null) {
expression.setValue(context, value);
return;
}
context.setPropertyResolved(false);
context.getELResolver().setValue(context, null, name, value);
if (!context.isPropertyResolved()) {
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:14,代码来源:AstIdentifier.java
示例12: getMethodInfo
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public MethodInfo getMethodInfo(Bindings bindings, ELContext context, Class<?> returnType, Class<?>[] paramTypes) {
Object base = prefix.eval(bindings, context);
if (base == null) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.base.null", prefix));
}
Object property = getProperty(bindings, context);
if (property == null && strict) {
throw new PropertyNotFoundException(LocalMessages.get("error.property.method.notfound", "null", base));
}
String name = bindings.convert(property, String.class);
Method method = findMethod(name, base.getClass(), returnType, paramTypes);
return new MethodInfo(method.getName(), method.getReturnType(), paramTypes);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:15,代码来源:AstProperty.java
示例13: eval
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object eval(Bindings bindings, ELContext context) {
Class<?>[] paramTypes = null;
if (params.getCardinality() == 1) {
AstNode astNode = params.getChild(0);
if (astNode instanceof AstString) {
paramTypes = new Class<?>[params.getCardinality()];
paramTypes[0] = String.class;
} else if (astNode instanceof AstBoolean) {
paramTypes = new Class<?>[params.getCardinality()];
paramTypes[0] = Boolean.class;
}
}
return invoke(bindings, context, null, paramTypes, null);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:16,代码来源:AstMethod.java
示例14: setValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public void setValue(ELContext context, Object base, Object property, Object value)
throws PropertyNotWritableException {
if (resolve(context, base, property)) {
if (readOnly) {
throw new PropertyNotWritableException("Resolver is read only!");
}
setProperty((String) property, value);
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:11,代码来源:RootPropertyResolver.java
示例15: getValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
/**
* evaluate and return the (optionally coerced) result.
*/
@Override
public final Object getValue(Bindings bindings, ELContext context, Class<?> type) {
Object value = eval(bindings, context);
if (type != null) {
value = bindings.convert(value, type);
}
return value;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:12,代码来源:AstNode.java
示例16: setValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base == null) {
if (wrappedMap.containsKey(property)) {
throw new ActivitiException("Cannot set value of '" + property + "', it's readonly!");
}
}
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:ReadOnlyMapELResolver.java
示例17: getValue
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object getValue(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property; // according to javadoc, can only be a String
if ((EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity)
|| (TASK_KEY.equals(property) && variableScope instanceof TaskEntity)) {
context.setPropertyResolved(true);
return variableScope;
} else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) {
context.setPropertyResolved(true);
return ((TaskEntity) variableScope).getExecution();
} else if (LOGGED_IN_USER_KEY.equals(property)) {
context.setPropertyResolved(true);
return Authentication.getAuthenticatedUserId();
} else {
if (variableScope.hasVariable(variable)) {
context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called
return variableScope.getVariable(variable);
}
}
}
// property resolution (eg. bean.value) will be done by the BeanElResolver (part of the CompositeElResolver)
// It will use the bean resolved in this resolver as base.
return null;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:30,代码来源:VariableScopeElResolver.java
示例18: eval
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object eval(Bindings bindings, ELContext context) {
StringBuilder b = new StringBuilder(16);
for (int i = 0; i < getCardinality(); i++) {
b.append(bindings.convert(nodes.get(i).eval(bindings, context), String.class));
}
return b.toString();
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:AstComposite.java
示例19: isReadOnly
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (base == null) {
String variable = (String) property;
return !variableScope.hasVariable(variable);
}
return true;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:VariableScopeElResolver.java
示例20: invoke
import org.activiti.engine.impl.javax.el.ELContext; //导入依赖的package包/类
@Override
public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
if (resolve(context, base, method)) {
throw new NullPointerException("Cannot invoke method " + method + " on null");
}
return null;
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:8,代码来源:RootPropertyResolver.java
注:本文中的org.activiti.engine.impl.javax.el.ELContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论