Search in sources :

Example 6 with SimpleDumpData

use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.

the class DateImpl method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    String str = castToString("");
    DumpTable table = new DumpTable("date", "#ff9900", "#ffcc00", "#000000");
    table.appendRow(1, new SimpleDumpData("Date"), new SimpleDumpData(str));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 7 with SimpleDumpData

use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.

the class ComponentImpl method thisScope.

static DumpTable thisScope(ComponentImpl ci, PageContext pc, int maxlevel, DumpProperties dp, int access) {
    DumpTable table = new DumpTable("#ffffff", "#cccccc", "#000000");
    DumpTable[] accesses = new DumpTable[4];
    accesses[Component.ACCESS_REMOTE] = new DumpTable("#ccffcc", "#ffffff", "#000000");
    accesses[Component.ACCESS_REMOTE].setTitle("remote");
    accesses[Component.ACCESS_PUBLIC] = new DumpTable("#ffcc99", "#ffffcc", "#000000");
    accesses[Component.ACCESS_PUBLIC].setTitle("public");
    accesses[Component.ACCESS_PACKAGE] = new DumpTable("#ff9966", "#ffcc99", "#000000");
    accesses[Component.ACCESS_PACKAGE].setTitle("package");
    accesses[Component.ACCESS_PRIVATE] = new DumpTable("#ff6633", "#ff9966", "#000000");
    accesses[Component.ACCESS_PRIVATE].setTitle("private");
    maxlevel--;
    ComponentSpecificAccess cw = new ComponentSpecificAccess(Component.ACCESS_PRIVATE, ci);
    Collection.Key[] keys = cw.keys();
    List<DumpRow>[] drAccess = new List[4];
    for (int i = 0; i < drAccess.length; i++) // ACCESS_REMOTE=0, ACCESS_PUBLIC=1, ACCESS_PACKAGE=2, ACCESS_PRIVATE=3
    drAccess[i] = new ArrayList();
    Collection.Key key;
    for (int i = 0; i < keys.length; i++) {
        key = keys[i];
        List<DumpRow> box = drAccess[ci.getAccess(key)];
        Object o = cw.get(key, null);
        if (o == ci)
            o = "[this]";
        if (DumpUtil.keyValid(dp, maxlevel, key)) {
            String memberName = (o instanceof UDF) ? ((UDF) o).getFunctionName() : key.getString();
            box.add(new DumpRow(1, new SimpleDumpData(memberName), DumpUtil.toDumpData(o, pc, maxlevel, dp)));
        }
    }
    List<DumpRow> dumpRows;
    for (int i = 0; i < drAccess.length; i++) {
        dumpRows = drAccess[i];
        if (!dumpRows.isEmpty()) {
            Collections.sort(dumpRows, new Comparator<DumpRow>() {

                @Override
                public int compare(DumpRow o1, DumpRow o2) {
                    DumpData[] rowItems1 = o1.getItems();
                    DumpData[] rowItems2 = o2.getItems();
                    if (rowItems1.length >= 0 && rowItems2.length > 0 && rowItems1[0] instanceof SimpleDumpData && rowItems2[0] instanceof SimpleDumpData)
                        return String.CASE_INSENSITIVE_ORDER.compare(rowItems1[0].toString(), rowItems2[0].toString());
                    return 0;
                }
            });
            DumpTable dtAccess = accesses[i];
            dtAccess.setWidth("100%");
            for (DumpRow dr : dumpRows) dtAccess.appendRow(dr);
            table.appendRow(0, dtAccess);
        }
    }
    // properties
    if (ci.top.properties.persistent || ci.top.properties.accessors) {
        Property[] properties = ci.getProperties(false, true, false, false);
        DumpTable prop = new DumpTable("#99cc99", "#ccffcc", "#000000");
        prop.setTitle("Properties");
        prop.setWidth("100%");
        Property p;
        Object child;
        for (int i = 0; i < properties.length; i++) {
            p = properties[i];
            child = ci.scope.get(KeyImpl.init(p.getName()), null);
            DumpData dd;
            if (child instanceof Component) {
                DumpTable t = new DumpTable("component", "#99cc99", "#ffffff", "#000000");
                t.appendRow(1, new SimpleDumpData(((Component) child).getPageSource().getDialect() == CFMLEngine.DIALECT_CFML ? "Component" : "Class"), new SimpleDumpData(((Component) child).getCallName()));
                dd = t;
            } else {
                dd = DumpUtil.toDumpData(child, pc, maxlevel - 1, dp);
            }
            prop.appendRow(1, new SimpleDumpData(p.getName()), dd);
        }
        if (access >= ACCESS_PUBLIC && !prop.isEmpty()) {
            table.appendRow(0, prop);
        }
    }
    return table;
}
Also used : DumpRow(lucee.runtime.dump.DumpRow) ArrayList(java.util.ArrayList) DumpData(lucee.runtime.dump.DumpData) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DumpTable(lucee.runtime.dump.DumpTable) UDF(lucee.runtime.type.UDF) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) Collection(lucee.runtime.type.Collection) List(java.util.List) ArrayList(java.util.ArrayList) EvaluateComponent(lucee.runtime.functions.dynamicEvaluation.EvaluateComponent) UDFGSProperty(lucee.runtime.type.UDFGSProperty) Property(lucee.runtime.component.Property) ArgumentIntKey(lucee.runtime.type.scope.ArgumentIntKey)

Example 8 with SimpleDumpData

use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.

the class ComponentImpl method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp, int access) {
    boolean isCFML = getPageSource().getDialect() == CFMLEngine.DIALECT_CFML;
    DumpTable table = isCFML ? new DumpTable("component", "#ff4542", "#ff9aad", "#000000") : new DumpTable("component", "#ca6b50", "#e9bcac", "#000000");
    table.setTitle((isCFML ? "Component" : "Class") + " " + getCallPath() + "" + (" " + StringUtil.escapeHTML(top.properties.dspName)));
    table.setComment("Only the functions and data members that are accessible from your location are displayed");
    // Extends
    if (!StringUtil.isEmpty(top.properties.extend, true))
        table.appendRow(1, new SimpleDumpData("Extends"), new SimpleDumpData(top.properties.extend));
    // Interfaces
    if (!StringUtil.isEmpty(top.properties.implement, true))
        table.appendRow(1, new SimpleDumpData("Implements"), new SimpleDumpData(top.properties.implement));
    if (top.properties.modifier != Member.MODIFIER_NONE)
        table.appendRow(1, new SimpleDumpData("Modifier"), new SimpleDumpData(ComponentUtil.toModifier(top.properties.modifier, "")));
    if (top.properties.hint.trim().length() > 0)
        table.appendRow(1, new SimpleDumpData("Hint"), new SimpleDumpData(top.properties.hint));
    // this
    DumpTable thisScope = thisScope(top, pageContext, maxlevel, dp, access);
    if (!thisScope.isEmpty())
        table.appendRow(1, new SimpleDumpData("this"), thisScope);
    // static
    DumpTable staticScope = _static._toDumpData(top, pageContext, maxlevel, dp, getAccess(pageContext));
    if (!staticScope.isEmpty())
        table.appendRow(1, new SimpleDumpData("static"), staticScope);
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 9 with SimpleDumpData

use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.

the class StaticScope method _toDumpData.

DumpTable _toDumpData(ComponentImpl ci, PageContext pc, int maxlevel, DumpProperties dp, int access) {
    maxlevel--;
    DumpTable[] accesses = new DumpTable[4];
    accesses[Component.ACCESS_PRIVATE] = new DumpTable("#ff6633", "#ff9966", "#000000");
    accesses[Component.ACCESS_PRIVATE].setTitle("private");
    accesses[Component.ACCESS_PRIVATE].setWidth("100%");
    accesses[Component.ACCESS_PACKAGE] = new DumpTable("#ff9966", "#ffcc99", "#000000");
    accesses[Component.ACCESS_PACKAGE].setTitle("package");
    accesses[Component.ACCESS_PACKAGE].setWidth("100%");
    accesses[Component.ACCESS_PUBLIC] = new DumpTable("#ffcc99", "#ffffcc", "#000000");
    accesses[Component.ACCESS_PUBLIC].setTitle("public");
    accesses[Component.ACCESS_PUBLIC].setWidth("100%");
    Iterator<Entry<Key, Member>> it = all(new HashMap<Key, Member>()).entrySet().iterator();
    Entry<Key, Member> e;
    while (it.hasNext()) {
        e = it.next();
        int a = access(pc, e.getValue().getAccess());
        DumpTable box = accesses[a];
        Object o = e.getValue().getValue();
        if (DumpUtil.keyValid(dp, maxlevel, e.getKey()))
            box.appendRow(1, new SimpleDumpData(e.getKey().getString()), DumpUtil.toDumpData(o, pc, maxlevel, dp));
    }
    DumpTable table = new DumpTable("#ffffff", "#cccccc", "#000000");
    if (!accesses[Component.ACCESS_PUBLIC].isEmpty()) {
        table.appendRow(0, accesses[Component.ACCESS_PUBLIC]);
    }
    if (!accesses[Component.ACCESS_PACKAGE].isEmpty()) {
        table.appendRow(0, accesses[Component.ACCESS_PACKAGE]);
    }
    if (!accesses[Component.ACCESS_PRIVATE].isEmpty()) {
        table.appendRow(0, accesses[Component.ACCESS_PRIVATE]);
    }
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) Member(lucee.runtime.component.Member) DataMember(lucee.runtime.component.DataMember)

Example 10 with SimpleDumpData

use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.

the class FileCacheItem method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
    DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
    table.setTitle("FileCacheEntry");
    table.appendRow(1, new SimpleDumpData("Path"), new SimpleDumpData(path));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Aggregations

DumpTable (lucee.runtime.dump.DumpTable)39 SimpleDumpData (lucee.runtime.dump.SimpleDumpData)39 DumpData (lucee.runtime.dump.DumpData)5 PageException (lucee.runtime.exp.PageException)4 Collection (lucee.runtime.type.Collection)4 Key (lucee.runtime.type.Collection.Key)4 DumpRow (lucee.runtime.dump.DumpRow)3 PageRuntimeException (lucee.runtime.exp.PageRuntimeException)3 Struct (lucee.runtime.type.Struct)3 IOException (java.io.IOException)2 Iterator (java.util.Iterator)2 Binding (javax.wsdl.Binding)2 BindingOperation (javax.wsdl.BindingOperation)2 Operation (javax.wsdl.Operation)2 Port (javax.wsdl.Port)2 QName (javax.xml.namespace.QName)2 DumpProperties (lucee.runtime.dump.DumpProperties)2 DumpWriter (lucee.runtime.dump.DumpWriter)2 ExpressionException (lucee.runtime.exp.ExpressionException)2 Array (lucee.runtime.type.Array)2