Java Code Examples for javax.el.ELContext#notifyBeforeEvaluation()

The following examples show how to use javax.el.ELContext#notifyBeforeEvaluation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Object getValue(ELContext context) {
    context.notifyBeforeEvaluation(getExpressionString());
    Object result;
    if (this.expectedType != null) {
        result = context.convertToType(this.value, this.expectedType);
    } else {
        result = this.value;
    }
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 2
Source File: ValueExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Class<?> getType(ELContext context) {
    context.notifyBeforeEvaluation(getExpressionString());
    Class<?> result = (this.value != null) ? this.value.getClass() : null;
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 3
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Class<?> getType(ELContext context) throws PropertyNotFoundException,
        ELException {
    EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
            this.varMapper);
    context.notifyBeforeEvaluation(getExpressionString());
    Class<?> result = this.getNode().getType(ctx);
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 4
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Object getValue(ELContext context) throws PropertyNotFoundException,
        ELException {
    EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
            this.varMapper);
    context.notifyBeforeEvaluation(getExpressionString());
    Object value = this.getNode().getValue(ctx);
    if (this.expectedType != null) {
        value = context.convertToType(value, this.expectedType);
    }
    context.notifyAfterEvaluation(getExpressionString());
    return value;
}
 
Example 5
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public boolean isReadOnly(ELContext context)
        throws PropertyNotFoundException, ELException {
    EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
            this.varMapper);
    context.notifyBeforeEvaluation(getExpressionString());
    boolean result = this.getNode().isReadOnly(ctx);
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 6
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public void setValue(ELContext context, Object value)
        throws PropertyNotFoundException, PropertyNotWritableException,
        ELException {
    EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
            this.varMapper);
    context.notifyBeforeEvaluation(getExpressionString());
    this.getNode().setValue(ctx, value);
    context.notifyAfterEvaluation(getExpressionString());
}
 
Example 7
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * @since EL 2.2
 */
@Override
public ValueReference getValueReference(ELContext context) {
    EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
            this.varMapper);
    context.notifyBeforeEvaluation(getExpressionString());
    ValueReference result = this.getNode().getValueReference(ctx);
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 8
Source File: MethodExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public MethodInfo getMethodInfo(ELContext context) throws ELException {
    context.notifyBeforeEvaluation(getExpressionString());
    MethodInfo result =
            new MethodInfo(this.expr, this.expectedType, this.paramTypes);
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 9
Source File: MethodExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Object invoke(ELContext context, Object[] params) throws ELException {
    context.notifyBeforeEvaluation(getExpressionString());
    Object result;
    if (this.expectedType != null) {
        result = context.convertToType(this.expr, this.expectedType);
    } else {
        result = this.expr;
    }
    context.notifyAfterEvaluation(getExpressionString());
    return result;
}
 
Example 10
Source File: ValueExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public void setValue(ELContext context, Object value) {
    context.notifyBeforeEvaluation(getExpressionString());
    throw new PropertyNotWritableException(MessageFactory.get(
            "error.value.literal.write", this.value));
}
 
Example 11
Source File: ValueExpressionLiteral.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public boolean isReadOnly(ELContext context) {
    context.notifyBeforeEvaluation(getExpressionString());
    context.notifyAfterEvaluation(getExpressionString());
    return true;
}