use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.
the class TOObjects method setEL.
@Override
public Object setEL(PageContext pc, Key key, Object value) {
log(key, value);
VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
return var.setEL(pc, o, key, value);
// return TraceObjectSupport.toTraceObject(debugger,var.setEL(pc, o, key, value),type,category,text);
}
use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.
the class TOObjects method call.
@Override
public Object call(PageContext pc, Key key, Object[] args) throws PageException {
log(key.getString());
VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
return var.callFunctionWithoutNamedValues(pc, o, key, args);
}
use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.
the class TOObjects method get.
@Override
public Object get(PageContext pc, Key key, Object defaultValue) {
log(key.getString());
VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
return var.get(pc, o, key, defaultValue);
// return TraceObjectSupport.toTraceObject(debugger,var.get(pc, o, key, defaultValue),type,category,text);
}
use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.
the class JavaObject method set.
@Override
public Object set(PageContext pc, Collection.Key propertyName, Object value) throws PageException {
if (isInit) {
return ((VariableUtilImpl) variableUtil).set(pc, object, propertyName, value);
}
// Field
Field[] fields = Reflector.getFieldsIgnoreCase(clazz, propertyName.getString(), null);
if (!ArrayUtil.isEmpty(fields) && Modifier.isStatic(fields[0].getModifiers())) {
try {
fields[0].set(null, value);
return value;
} catch (Exception e) {
Caster.toPageException(e);
}
}
// Getter
MethodInstance mi = Reflector.getSetter(clazz, propertyName.getString(), value, null);
if (mi != null) {
if (Modifier.isStatic(mi.getMethod().getModifiers())) {
try {
return mi.invoke(null);
} catch (IllegalAccessException e) {
throw Caster.toPageException(e);
} catch (InvocationTargetException e) {
throw Caster.toPageException(e.getTargetException());
}
}
}
return ((VariableUtilImpl) variableUtil).set(pc, init(), propertyName, value);
}
Aggregations