use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class XMLAttributes method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
Collection.Key[] keys = keys();
maxlevel--;
DumpTable table = new DumpTable("xml", "#999966", "#cccc99", "#000000");
table.setTitle("Struct (XML Attributes)");
int maxkeys = dp.getMaxKeys();
int index = 0;
Collection.Key k;
for (int i = 0; i < keys.length; i++) {
k = keys[i];
if (DumpUtil.keyValid(dp, maxlevel, k)) {
if (maxkeys <= index++)
break;
table.appendRow(1, new SimpleDumpData(k.getString()), DumpUtil.toDumpData(get(k.getString(), null), pageContext, maxlevel, dp));
}
}
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class XMLCaster method toDumpData.
/**
* Casts a XML Node to a HTML Presentation
* @param node
* @param pageContext
* @return html output
*/
public static DumpData toDumpData(Node node, PageContext pageContext, int maxlevel, DumpProperties props) {
if (maxlevel <= 0) {
return DumpUtil.MAX_LEVEL_REACHED;
}
maxlevel--;
// Document
if (node instanceof Document) {
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("XML Document");
table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlRoot"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLROOT, null), pageContext, maxlevel, props));
return table;
}
// Element
if (node instanceof Element) {
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("XML Element");
table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlNsPrefix"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSPREFIX, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlNsURI"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSURI, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlText"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLTEXT, null), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlAttributes"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLATTRIBUTES, null), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlChildren"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCHILDREN, null), pageContext, maxlevel, props));
return table;
}
// Text
if (node instanceof Text) {
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("XML Text");
Text txt = (Text) node;
table.appendRow(1, new SimpleDumpData("XmlText"), new SimpleDumpData(txt.getData()));
return table;
}
// Attr
if (node instanceof Attr) {
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("XML Attr");
table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlValue"), DumpUtil.toDumpData(((Attr) node).getValue(), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlType"), new SimpleDumpData(XMLUtil.getTypeAsString(node, true)));
return table;
}
// Node
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("XML Node (" + ListLast.call(null, node.getClass().getName(), ".") + ")");
table.appendRow(1, new SimpleDumpData("xmlName"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNAME, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlNsPrefix"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSPREFIX, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlNsURI"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLNSURI, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlText"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLTEXT, null), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlComment"), new SimpleDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCOMMENT, null).toString()));
table.appendRow(1, new SimpleDumpData("XmlAttributes"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLATTRIBUTES, null), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlChildren"), DumpUtil.toDumpData(XMLUtil.getProperty(node, XMLUtil.XMLCHILDREN, null), pageContext, maxlevel, props));
table.appendRow(1, new SimpleDumpData("XmlType"), new SimpleDumpData(XMLUtil.getTypeAsString(node, true)));
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class XMLNodeList method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
maxlevel--;
DumpTable table = new DumpTable("xml", "#cc9999", "#ffffff", "#000000");
table.setTitle("Array (XML Node List)");
int len = size();
for (int i = 1; i <= len; i++) {
table.appendRow(1, new SimpleDumpData(i), DumpUtil.toDumpData(item(i - 1), pageContext, maxlevel, dp));
}
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class ThreadsImpl method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
Key[] keys = keys();
DumpTable table = new DumpTable("struct", "#9999ff", "#ccccff", "#000000");
table.setTitle("Struct");
maxlevel--;
int maxkeys = dp.getMaxKeys();
int index = 0;
for (int i = 0; i < keys.length; i++) {
Key key = keys[i];
if (maxkeys <= index++)
break;
if (DumpUtil.keyValid(dp, maxlevel, key))
table.appendRow(1, new SimpleDumpData(key.getString()), DumpUtil.toDumpData(get(key, null), pageContext, maxlevel, dp));
}
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class ArrayClassic method toDumpData.
/**
* @return return array as ArrayList
*/
/*public synchronized ArrayList toArrayList() {
ArrayList al=new ArrayList();
for(int i=offset;i<offset+size;i++) {
al.add(arr[i]);
}
return al;
}*/
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
DumpTable table = new DumpTable("array", "#99cc33", "#ccff33", "#000000");
table.setTitle("Array");
int top = dp.getMaxlevel();
if (size() > top)
table.setComment("Rows: " + size() + " (showing top " + top + ")");
else if (size() > 10 && dp.getMetainfo())
table.setComment("Rows: " + size());
int length = size();
for (int i = 1; i <= length; i++) {
Object o = null;
try {
o = getE(i);
} catch (Exception e) {
}
table.appendRow(1, new SimpleDumpData(i), DumpUtil.toDumpData(o, pageContext, maxlevel, dp));
if (i == top)
break;
}
return table;
}
Aggregations