Java Code Examples for org.apache.commons.jexl3.introspection.JexlMethod#getReturnType()

The following examples show how to use org.apache.commons.jexl3.introspection.JexlMethod#getReturnType() . 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: Operators.java    From commons-jexl with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether a method returns a boolean or a Boolean.
 * @param vm the JexlMethod (may be null)
 * @return true of false
 */
private boolean returnsBoolean(JexlMethod vm) {
    if (vm !=null) {
        Class<?> rc = vm.getReturnType();
        return Boolean.TYPE.equals(rc) || Boolean.class.equals(rc);
    }
    return false;
}
 
Example 2
Source File: Operators.java    From commons-jexl with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether a method returns an int or an Integer.
 * @param vm the JexlMethod (may be null)
 * @return true of false
 */
private boolean returnsInteger(JexlMethod vm) {
    if (vm !=null) {
        Class<?> rc = vm.getReturnType();
        return Integer.TYPE.equals(rc) || Integer.class.equals(rc);
    }
    return false;
}