Search in sources :

Example 11 with SimpleDumpData

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

the class IncludeCacheItem method toDumpData.

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

Example 12 with SimpleDumpData

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

the class UDFCacheItem method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
    DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
    table.setTitle("UDFCacheEntry");
    table.appendRow(1, new SimpleDumpData("Return Value"), DumpUtil.toDumpData(returnValue, pageContext, maxlevel, properties));
    table.appendRow(1, new SimpleDumpData("Output"), DumpUtil.toDumpData(new SimpleDumpData(output), pageContext, maxlevel, properties));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 13 with SimpleDumpData

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

the class WebserviceCacheItem method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
    DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
    table.setTitle("WebserviceCacheEntry");
    table.appendRow(1, new SimpleDumpData("URL"), DumpUtil.toDumpData(new SimpleDumpData(url), pageContext, maxlevel, properties));
    table.appendRow(1, new SimpleDumpData("Method Name"), DumpUtil.toDumpData(new SimpleDumpData(methodName), pageContext, maxlevel, properties));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 14 with SimpleDumpData

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

the class COMObject method toDumpData.

@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
    DumpTable table = new DumpTable("com", "#ff3300", "#ff9966", "#660000");
    table.appendRow(1, new SimpleDumpData("COM Object"), new SimpleDumpData(name));
    return table;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 15 with SimpleDumpData

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

the class UDFUtil method toDumpData.

public static DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp, UDF udf, short type) {
    if (!dp.getShowUDFs()) {
        if (TYPE_UDF == type)
            return new SimpleDumpData("<UDF>");
        if (TYPE_BIF == type)
            return new SimpleDumpData("<BIF>");
        if (TYPE_CLOSURE == type)
            return new SimpleDumpData("<Closure>");
        if (TYPE_LAMBDA == type)
            return new SimpleDumpData("<Lambda>");
    }
    // arguments
    FunctionArgument[] args = udf.getFunctionArguments();
    DumpTable atts;
    if (TYPE_UDF == type)
        atts = new DumpTable("udf", "#ca5095", "#e9accc", "#000000");
    else if (TYPE_CLOSURE == type)
        atts = new DumpTable("udf", "#9cb770", "#c7e1ba", "#000000");
    else if (TYPE_BIF == type)
        atts = new DumpTable("udf", "#e1c039", "#f1e2a3", "#000000");
    else
        atts = new DumpTable("udf", "#f3d5bd", "#f6e4cc", "#000000");
    atts.appendRow(new DumpRow(63, new DumpData[] { new SimpleDumpData("label"), new SimpleDumpData("name"), new SimpleDumpData("required"), new SimpleDumpData("type"), new SimpleDumpData("default"), new SimpleDumpData("hint") }));
    for (int i = 0; i < args.length; i++) {
        FunctionArgument arg = args[i];
        DumpData def;
        try {
            Object oa = udf.getDefaultValue(pageContext, i, null);
            if (oa == null)
                oa = "null";
            def = new SimpleDumpData(Caster.toString(oa));
        } catch (PageException e) {
            def = new SimpleDumpData("");
        }
        atts.appendRow(new DumpRow(0, new DumpData[] { new SimpleDumpData(arg.getDisplayName()), new SimpleDumpData(arg.getName().getString()), new SimpleDumpData(arg.isRequired()), new SimpleDumpData(arg.getTypeAsString()), def, new SimpleDumpData(arg.getHint()) }));
    // atts.setRow(0,arg.getHint());
    }
    DumpTable func;
    String label = udf.getDisplayName();
    if (TYPE_CLOSURE == type) {
        func = new DumpTable("#9cb770", "#c7e1ba", "#000000");
        func.setTitle(StringUtil.isEmpty(label) ? "Closure" : "Closure " + label);
    } else if (TYPE_UDF == type) {
        func = new DumpTable("#ca5095", "#e9accc", "#000000");
        String f = "Function ";
        try {
            f = StringUtil.ucFirst(ComponentUtil.toStringAccess(udf.getAccess()).toLowerCase()) + " " + f;
        } catch (ApplicationException e) {
        }
        f += udf.getFunctionName();
        if (udf instanceof UDFGSProperty)
            f += " (generated)";
        func.setTitle(f);
    } else if (TYPE_BIF == type) {
        String f = "Build in Function " + (!StringUtil.isEmpty(label) ? label : udf.getFunctionName());
        func = new DumpTable("#e1c039", "#f1e2a3", "#000000");
        func.setTitle(f);
    } else {
        func = new DumpTable("#f3d5bd", "#f6e4cc", "#000000");
        func.setTitle(StringUtil.isEmpty(label) ? "Lambda" : "Lambda " + label);
    }
    // Source
    String src = udf.getSource();
    if (!StringUtil.isEmpty(src))
        func.setComment("source:" + src);
    String hint = udf.getHint();
    String desc = udf.getDescription();
    if (!StringUtil.isEmpty(desc))
        addComment(func, desc);
    if (!StringUtil.isEmpty(hint))
        addComment(func, hint);
    if (Component.MODIFIER_NONE != udf.getModifier())
        func.appendRow(1, new SimpleDumpData("modifier"), new SimpleDumpData(ComponentUtil.toModifier(udf.getModifier(), "")));
    func.appendRow(1, new SimpleDumpData("arguments"), atts);
    func.appendRow(1, new SimpleDumpData("return type"), new SimpleDumpData(udf.getReturnTypeAsString()));
    return func;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) PageException(lucee.runtime.exp.PageException) ApplicationException(lucee.runtime.exp.ApplicationException) DumpRow(lucee.runtime.dump.DumpRow) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) UDFGSProperty(lucee.runtime.type.UDFGSProperty) FunctionArgument(lucee.runtime.type.FunctionArgument) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DumpData(lucee.runtime.dump.DumpData)

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