Search in sources :

Example 1 with PropertyNotFoundException

use of org.activiti.engine.impl.javax.el.PropertyNotFoundException in project Activiti by Activiti.

the class AstIdentifier method getType.

public Class<?> getType(Bindings bindings, ELContext context) {
    ValueExpression expression = bindings.getVariable(index);
    if (expression != null) {
        return expression.getType(context);
    }
    context.setPropertyResolved(false);
    Class<?> result = context.getELResolver().getType(context, null, name);
    if (!context.isPropertyResolved()) {
        throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
    }
    return result;
}
Also used : PropertyNotFoundException(org.activiti.engine.impl.javax.el.PropertyNotFoundException) ValueExpression(org.activiti.engine.impl.javax.el.ValueExpression)

Example 2 with PropertyNotFoundException

use of org.activiti.engine.impl.javax.el.PropertyNotFoundException in project Activiti by Activiti.

the class AstIdentifier method setValue.

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));
    }
}
Also used : PropertyNotFoundException(org.activiti.engine.impl.javax.el.PropertyNotFoundException) ValueExpression(org.activiti.engine.impl.javax.el.ValueExpression)

Example 3 with PropertyNotFoundException

use of org.activiti.engine.impl.javax.el.PropertyNotFoundException in project Activiti by Activiti.

the class AstIdentifier method eval.

@Override
public Object eval(Bindings bindings, ELContext context) {
    ValueExpression expression = bindings.getVariable(index);
    if (expression != null) {
        return expression.getValue(context);
    }
    context.setPropertyResolved(false);
    Object result = context.getELResolver().getValue(context, null, name);
    if (!context.isPropertyResolved()) {
        throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name));
    }
    return result;
}
Also used : PropertyNotFoundException(org.activiti.engine.impl.javax.el.PropertyNotFoundException) ValueExpression(org.activiti.engine.impl.javax.el.ValueExpression)

Example 4 with PropertyNotFoundException

use of org.activiti.engine.impl.javax.el.PropertyNotFoundException in project Activiti by Activiti.

the class AstIdentifier method isReadOnly.

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;
}
Also used : PropertyNotFoundException(org.activiti.engine.impl.javax.el.PropertyNotFoundException) ValueExpression(org.activiti.engine.impl.javax.el.ValueExpression)

Example 5 with PropertyNotFoundException

use of org.activiti.engine.impl.javax.el.PropertyNotFoundException in project Activiti by Activiti.

the class AstProperty method getMethodInfo.

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);
}
Also used : PropertyNotFoundException(org.activiti.engine.impl.javax.el.PropertyNotFoundException) MethodInfo(org.activiti.engine.impl.javax.el.MethodInfo) Method(java.lang.reflect.Method)

Aggregations

PropertyNotFoundException (org.activiti.engine.impl.javax.el.PropertyNotFoundException)8 ValueExpression (org.activiti.engine.impl.javax.el.ValueExpression)4 Method (java.lang.reflect.Method)2 ActivitiException (org.activiti.engine.ActivitiException)2 ELException (org.activiti.engine.impl.javax.el.ELException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ExpressionGetInvocation (org.activiti.engine.impl.delegate.ExpressionGetInvocation)1 ELContext (org.activiti.engine.impl.javax.el.ELContext)1 MethodInfo (org.activiti.engine.impl.javax.el.MethodInfo)1 MethodNotFoundException (org.activiti.engine.impl.javax.el.MethodNotFoundException)1 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1 Deployment (org.activiti.engine.test.Deployment)1