use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class DebuggerUtil method pointOutClosuresInPersistentScopes.
public Struct pointOutClosuresInPersistentScopes(PageContext pc) {
Struct sct = new StructImpl();
Set<Object> done = new HashSet<Object>();
// Application Scope
try {
sct.set(KeyConstants._application, _pointOutClosuresInPersistentScopes(pc, pc.applicationScope(), done));
} catch (PageException e) {
}
// Session Scope
try {
sct.set(KeyConstants._application, _pointOutClosuresInPersistentScopes(pc, pc.sessionScope(), done));
} catch (PageException e) {
}
// Server Scope
try {
sct.set(KeyConstants._application, _pointOutClosuresInPersistentScopes(pc, pc.serverScope(), done));
} catch (PageException e) {
}
return null;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class DumpUtil method toArray2.
private static Array toArray2(List<PackageQuery> list) {
Struct sct, _sct;
Array arr = new ArrayImpl(), _arr;
Iterator<PackageQuery> it = list.iterator();
PackageQuery pd;
Iterator<VersionDefinition> _it;
VersionDefinition vd;
while (it.hasNext()) {
pd = it.next();
sct = new StructImpl();
sct.setEL(KeyConstants._package, pd.getName());
sct.setEL("versions", _arr = new ArrayImpl());
_it = pd.getVersionDefinitons().iterator();
while (_it.hasNext()) {
vd = _it.next();
_sct = new StructImpl();
_sct.setEL(KeyConstants._bundleVersion, vd.getVersion().toString());
_sct.setEL("operator", vd.getOpAsString());
_arr.appendEL(_sct);
}
arr.appendEL(sct);
}
return arr;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class Filter method invoke.
private static Struct invoke(PageContext pc, Iteratorable i, UDF udf, ExecutorService es, List<Future<Data<Pair<Object, Object>>>> futures) throws PageException {
Iterator<Entry<Key, Object>> it = i.entryIterator();
Struct rtn = new StructImpl();
Entry<Key, Object> e;
boolean async = es != null;
Object res;
while (it.hasNext()) {
e = it.next();
res = _inv(pc, udf, new Object[] { e.getKey().getString(), e.getValue() }, e.getKey(), e.getValue(), es, futures);
if (!async && Caster.toBooleanValue(res))
rtn.set(e.getKey(), e.getValue());
}
return rtn;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class Map method invoke.
private static Struct invoke(PageContext pc, Struct sct, UDF udf, ExecutorService es, List<Future<Data<Object>>> futures) throws PageException {
Struct rtn = sct instanceof StructImpl ? new StructImpl(((StructImpl) sct).getType()) : new StructImpl();
Iterator<Entry<Key, Object>> it = sct.entryIterator();
Entry<Key, Object> e;
boolean async = es != null;
Object res;
while (it.hasNext()) {
e = it.next();
res = _inv(pc, udf, new Object[] { e.getKey().getString(), e.getValue(), sct }, e.getKey(), es, futures);
if (!async)
rtn.set(e.getKey(), res);
}
return rtn;
}
use of lucee.runtime.type.StructImpl in project Lucee by lucee.
the class ComponentInfo method call.
public static Struct call(PageContext pc, Component component) {
DeprecatedUtil.function(pc, "ComponentInfo", "GetMetaData");
Struct sct = new StructImpl();
sct.setEL(KeyConstants._name, component.getName());
sct.setEL(KeyConstants._fullname, component.getCallName());
String extend = component.getExtends();
// TODO Object instead?
if (extend == null || extend.length() == 0)
extend = "Component";
sct.setEL(KeyConstants._extends, extend);
sct.setEL(KeyConstants._hint, component.getHint());
return sct;
}
Aggregations