use of lucee.runtime.type.ArrayImpl in project Lucee by lucee.
the class XMLConverter method _deserializeArray.
/**
* Desirialize a Struct Object
* @param el Struct Object as XML Element
* @return Struct Object
* @throws ConverterException
*/
private Array _deserializeArray(Element el) throws ConverterException {
Array array = new ArrayImpl();
NodeList list = el.getChildNodes();
int len = list.getLength();
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element)
try {
array.append(_deserialize((Element) node));
} catch (PageException e) {
throw toConverterException(e);
}
}
return array;
}
use of lucee.runtime.type.ArrayImpl in project Lucee by lucee.
the class PageExceptionImpl method getTagContext.
public static Array getTagContext(Config config, StackTraceElement[] traces) {
Array tagContext = new ArrayImpl();
_getTagContext(config, tagContext, traces, new LinkedList<PageSource>());
return tagContext;
}
use of lucee.runtime.type.ArrayImpl in project Lucee by lucee.
the class ArrayMerge method call.
public static Array call(PageContext pc, Array arr1, Array arr2, boolean leaveIndex) throws PageException {
ArrayImpl arr = new ArrayImpl(true, arr1.size() + arr2.size());
if (leaveIndex) {
set(arr, arr2);
set(arr, arr1);
return arr;
}
append(arr, arr1);
append(arr, arr2);
return arr;
}
use of lucee.runtime.type.ArrayImpl in project Lucee by lucee.
the class CacheGetProperties method call.
public static Array call(PageContext pc, String cacheName) throws PageException {
Array arr = new ArrayImpl();
try {
if (StringUtil.isEmpty(cacheName)) {
addDefault(pc, Config.CACHE_TYPE_OBJECT, arr);
addDefault(pc, Config.CACHE_TYPE_TEMPLATE, arr);
addDefault(pc, Config.CACHE_TYPE_QUERY, arr);
addDefault(pc, Config.CACHE_TYPE_RESOURCE, arr);
addDefault(pc, Config.CACHE_TYPE_FUNCTION, arr);
addDefault(pc, Config.CACHE_TYPE_INCLUDE, arr);
addDefault(pc, Config.CACHE_TYPE_HTTP, arr);
addDefault(pc, Config.CACHE_TYPE_FILE, arr);
addDefault(pc, Config.CACHE_TYPE_WEBSERVICE, arr);
// MUST welcher muss zuers sein
} else {
String name;
String[] names = ListUtil.listToStringArray(cacheName, ',');
for (int i = 0; i < names.length; i++) {
name = names[i].trim();
if (name.equalsIgnoreCase("template"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_TEMPLATE).getCustomInfo());
else if (name.equalsIgnoreCase("object"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_OBJECT).getCustomInfo());
else if (name.equalsIgnoreCase("query"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_QUERY).getCustomInfo());
else if (name.equalsIgnoreCase("resource"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_RESOURCE).getCustomInfo());
else if (name.equalsIgnoreCase("function"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_FUNCTION).getCustomInfo());
else if (name.equalsIgnoreCase("include"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_INCLUDE).getCustomInfo());
else if (name.equalsIgnoreCase("http"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_HTTP).getCustomInfo());
else if (name.equalsIgnoreCase("file"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_FILE).getCustomInfo());
else if (name.equalsIgnoreCase("webservice"))
arr.appendEL(CacheUtil.getDefault(pc, Config.CACHE_TYPE_WEBSERVICE).getCustomInfo());
else
arr.appendEL(CacheUtil.getCache(pc, name).getCustomInfo());
}
}
return arr;
} catch (IOException e) {
throw Caster.toPageException(e);
}
}
use of lucee.runtime.type.ArrayImpl in project Lucee by lucee.
the class DebuggerPool method getData.
public Array getData(PageContext pc) {
Iterator<Struct> it;
synchronized (queue) {
it = queue.iterator();
}
Array arr = new ArrayImpl();
while (it.hasNext()) {
arr.appendEL(it.next());
}
return arr;
}
Aggregations