Search in sources :

Example 1 with VariableUtilImpl

use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.

the class Elvis method _operate.

private static boolean _operate(PageContext pc, double scope, Collection.Key[] varNames, int startIndex) {
    Object defVal = null;
    try {
        Object coll = VariableInterpreter.scope(pc, (int) scope, false);
        // Object coll =pc.scope((int)scope);
        VariableUtilImpl vu = ((VariableUtilImpl) pc.getVariableUtil());
        for (int i = startIndex; i < varNames.length; i++) {
            coll = vu.getCollection(pc, coll, varNames[i], defVal);
            if (coll == defVal)
                return false;
        }
    } catch (Throwable t) {
        ExceptionUtil.rethrowIfNecessary(t);
        return false;
    }
    return true;
}
Also used : VariableUtilImpl(lucee.runtime.util.VariableUtilImpl)

Example 2 with VariableUtilImpl

use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.

the class IsDefined method call.

public static boolean call(PageContext pc, double scope, Collection.Key[] varNames) {
    Object defVal = NullSupportHelper.NULL(pc);
    try {
        Object coll = VariableInterpreter.scope(pc, (int) scope, false);
        // Object coll =pc.scope((int)scope);
        VariableUtilImpl vu = ((VariableUtilImpl) pc.getVariableUtil());
        for (int i = 0; i < varNames.length; i++) {
            coll = vu.getCollection(pc, coll, varNames[i], defVal);
            if (coll == defVal)
                return false;
        }
    } catch (Throwable t) {
        ExceptionUtil.rethrowIfNecessary(t);
        return false;
    }
    return true;
}
Also used : VariableUtilImpl(lucee.runtime.util.VariableUtilImpl)

Example 3 with VariableUtilImpl

use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.

the class TOObjects method set.

@Override
public Object set(PageContext pc, Key key, Object value) throws PageException {
    log(key, value);
    VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
    return var.set(pc, o, key, value);
// return TraceObjectSupport.toTraceObject(debugger,var.set(pc, o, key, value),type,category,text);
}
Also used : VariableUtilImpl(lucee.runtime.util.VariableUtilImpl)

Example 4 with VariableUtilImpl

use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.

the class TOObjects method get.

@Override
public Object get(PageContext pc, Key key) throws PageException {
    log(key.getString());
    VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
    return var.get(pc, o, key);
// return TraceObjectSupport.toTraceObject(debugger,var.get(pc, o, key),type,category,text);
}
Also used : VariableUtilImpl(lucee.runtime.util.VariableUtilImpl)

Example 5 with VariableUtilImpl

use of lucee.runtime.util.VariableUtilImpl in project Lucee by lucee.

the class TOObjects method callWithNamedValues.

@Override
public Object callWithNamedValues(PageContext pc, Key key, Struct args) throws PageException {
    log(key.getString());
    VariableUtilImpl var = (VariableUtilImpl) pc.getVariableUtil();
    return var.callFunctionWithNamedValues(pc, o, key, args);
}
Also used : VariableUtilImpl(lucee.runtime.util.VariableUtilImpl)

Aggregations

VariableUtilImpl (lucee.runtime.util.VariableUtilImpl)9 Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ExpressionException (lucee.runtime.exp.ExpressionException)1 PageException (lucee.runtime.exp.PageException)1 MethodInstance (lucee.runtime.reflection.pairs.MethodInstance)1