Search in sources :

Example 1 with GeneralGetMethodInvoker

use of org.beetl.core.om.GeneralGetMethodInvoker in project beetl2.0 by javamonkey.

the class HasAttributeFunction method call.

@Override
public Object call(Object[] paras, Context ctx) {
    Object o = paras[0];
    if (o == null) {
        throw new NullPointerException();
    }
    if (o instanceof Map) {
        return false;
    }
    Class type = o.getClass();
    for (int i = 1; i < paras.length; i++) {
        String key = (String) paras[i];
        MethodInvoker invoke = ObjectUtil.getInvokder(type, key);
        if (invoke == null) {
            return false;
        } else if (invoke instanceof GeneralGetMethodInvoker) {
            return false;
        }
    }
    return true;
}
Also used : GeneralGetMethodInvoker(org.beetl.core.om.GeneralGetMethodInvoker) Map(java.util.Map) GeneralGetMethodInvoker(org.beetl.core.om.GeneralGetMethodInvoker) MethodInvoker(org.beetl.core.om.MethodInvoker)

Aggregations

Map (java.util.Map)1 GeneralGetMethodInvoker (org.beetl.core.om.GeneralGetMethodInvoker)1 MethodInvoker (org.beetl.core.om.MethodInvoker)1