org.apache.el.MethodExpressionImpl Java Examples

The following examples show how to use org.apache.el.MethodExpressionImpl. 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: ExpressionBuilder.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
public MethodExpression createMethodExpression(Class<?> expectedReturnType,
        Class<?>[] expectedParamTypes) throws ELException {
    Node n = this.build();
    if (!n.isParametersProvided() && expectedParamTypes == null) {
        throw new NullPointerException(MessageFactory
                .get("error.method.nullParms"));
    }
    if (n instanceof AstValue || n instanceof AstIdentifier) {
        return new MethodExpressionImpl(expression, n, this.fnMapper,
                this.varMapper, expectedReturnType, expectedParamTypes);
    } else if (n instanceof AstLiteralExpression) {
        return new MethodExpressionLiteral(expression, expectedReturnType,
                expectedParamTypes);
    } else {
        throw new ELException("Not a Valid Method Expression: "
                + expression);
    }
}
 
Example #2
Source File: ExpressionBuilder.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
public MethodExpression createMethodExpression(Class<?> expectedReturnType,
        Class<?>[] expectedParamTypes) throws ELException {
    Node n = this.build();
    if (!n.isParametersProvided() && expectedParamTypes == null) {
        throw new NullPointerException(MessageFactory
                .get("error.method.nullParms"));
    }
    if (n instanceof AstValue || n instanceof AstIdentifier) {
        return new MethodExpressionImpl(expression, n, this.fnMapper,
                this.varMapper, expectedReturnType, expectedParamTypes);
    } else if (n instanceof AstLiteralExpression) {
        return new MethodExpressionLiteral(expression, expectedReturnType,
                expectedParamTypes);
    } else {
        throw new ELException("Not a Valid Method Expression: "
                + expression);
    }
}
 
Example #3
Source File: ExpressionBuilder.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
public MethodExpression createMethodExpression(Class<?> expectedReturnType,
        Class<?>[] expectedParamTypes) throws ELException {
    Node n = this.build();
    if (!n.isParametersProvided() && expectedParamTypes == null) {
        throw new NullPointerException(MessageFactory
                .get("error.method.nullParms"));
    }
    if (n instanceof AstValue || n instanceof AstIdentifier) {
        return new MethodExpressionImpl(expression, n, this.fnMapper,
                this.varMapper, expectedReturnType, expectedParamTypes);
    } else if (n instanceof AstLiteralExpression) {
        return new MethodExpressionLiteral(expression, expectedReturnType,
                expectedParamTypes);
    } else {
        throw new ELException("Not a Valid Method Expression: "
                + expression);
    }
}