use of lucee.runtime.type.UDFPlus in project Lucee by lucee.
the class ComponentImpl method callGetter.
private Object callGetter(PageContext pc, Collection.Key key, Object defaultValue) {
Key getterName = KeyImpl.getInstance("get" + key.getLowerString());
Member member = getMember(pc, getterName, false, false);
if (member instanceof UDFPlus) {
UDFPlus udf = (UDFPlus) member;
if (udf.getFunctionArguments().length == 0 && udf.getReturnType() != CFTypes.TYPE_VOID) {
try {
return _call(pc, getterName, udf, null, ArrayUtil.OBJECT_EMPTY);
} catch (PageException e) {
return defaultValue;
}
}
}
return defaultValue;
}
use of lucee.runtime.type.UDFPlus in project Lucee by lucee.
the class Operator method isComparableComponent.
private static boolean isComparableComponent(Castable c) {
if (!(c instanceof Component))
return false;
Member member = ((Component) c).getMember(Component.ACCESS_PRIVATE, KeyConstants.__compare, false, false);
if (!(member instanceof UDFPlus))
return false;
UDFPlus udf = (UDFPlus) member;
if (udf.getReturnType() == CFTypes.TYPE_NUMERIC && udf.getFunctionArguments().length == 1) {
return true;
}
return false;
}
Aggregations