Package org.apache.isis.core.commons.debug

Examples of org.apache.isis.core.commons.debug.DebugString


            } else if (type.equals("object")) {
                final String value = request.getOptionalProperty(VALUE);
                final RequestContext context = request.getContext();
                final ObjectAdapter object = context.getMappedObject(value);
                final DebugString str = new DebugString();
                Dump.adapter(object, str);
                Dump.graph(object, IsisContext.getAuthenticationSession(), str);
                request.appendHtml("<h2>" + object.getSpecification().getFullIdentifier() + "</h2>");
                request.appendHtml("<pre class=\"debug\">" + str + "</pre>");
            }

        }

        if (alwaysShow || request.getContext().getDebug() == RequestContext.Debug.ON) {

            final RequestContext context = request.getContext();

            final String id = request.getOptionalProperty("object");
            if (id != null) {
                final ObjectAdapter object = context.getMappedObject(id);
                if (object instanceof DebuggableWithTitle) {
                    final DebugString debug = new DebugString();
                    ((DebuggableWithTitle) object).debugData(debug);
                    request.appendHtml("<pre class=\"debug\">" + debug + "</pre>");
                } else {
                    request.appendHtml(object.toString());
                }
            }

            final String variable = request.getOptionalProperty("variable");
            if (variable != null) {
                final Object object = context.getVariable(variable);
                request.appendHtml(variable + " => " + (object == null ? "null" : object.toString()));
            }

            final String list = request.getOptionalProperty("list");
            if (list != null) {
                final DebugString debug = new DebugString();
                context.append(debug, list);
                request.appendHtml(debug.toString());
            }

            final String uri = request.getOptionalProperty("uri");
            if (uri != null) {
                request.appendHtml("<pre class=\"debug\">");
View Full Code Here


        }
    }

    private void object(final RequestContext context, final DebugWriter view) {
        final ObjectAdapter object = context.getMappedObjectOrResult(context.getParameter("object"));
        final DebugString str = new DebugString();
        Dump.adapter(object, str);
        Dump.graph(object, IsisContext.getAuthenticationSession(), str);
        view.appendTitle(object.getSpecification().getFullIdentifier());
        view.appendln("<pre class=\"debug\">" + str + "</pre>");
    }
View Full Code Here

    private void system(final RequestContext context, final DebugWriter view) {
        final DebuggableWithTitle[] debug = IsisContext.debugSystem();
        view.appendTitle("System");
        for (final DebuggableWithTitle element2 : debug) {
            final DebugString str = new DebugString();
            element2.debugData(str);
            view.appendTitle(element2.debugTitle());
            view.appendln("<pre class=\"debug\">" + str + "</pre>");
        }
    }
View Full Code Here

    protected void objectGraph(final Request request) {
        final String id = request.getOptionalProperty(VALUE);
        final ObjectAdapter object = request.getContext().getMappedObjectOrResult(id);
        request.appendHtml("<h1>Object Graph - " + object + "</h1>");
        request.appendHtml("<pre>");
        final DebugBuilder debug = new DebugString();
        Dump.graph(object, null, debug);
        request.appendHtml(debug.toString());
        request.appendHtml("</pre>");
    }
View Full Code Here

    public void takeSnapshot() {
        if (!LOG.isDebugEnabled()) {
            return;
        }
        final DebugString debug = new DebugString();
        debug(debug);
        debug.indent();
        debug.appendln();

        debug(debug, getPersistenceSession());
        if (getCurrentTransaction() != null) {
            debug(debug, getCurrentTransaction().getUpdateNotifier());
            debug(debug, getCurrentTransaction().getMessageBroker());
        }
        debugSnapshot = debug.toString();

        LOG.debug(debugSnapshot);
    }
View Full Code Here

    // debug, toString
    // //////////////////////////////////////////////////////////////////

    @Override
    public String debugData() {
        final DebugString debugString = new DebugString();
        getFacetedMethod().debugData(debugString);
        return debugString.toString();
    }
View Full Code Here

    // debug, toString
    // //////////////////////////////////////////////////////////////////

    @Override
    public String debugData() {
        final DebugString debugString = new DebugString();
        getFacetedMethod().debugData(debugString);
        return debugString.toString();
    }
View Full Code Here

    // debug, toString
    // /////////////////////////////////////////////////////////////

    @Override
    public String debugData() {
        final DebugString debugString = new DebugString();
        debugString.indent();
        debugString.indent();
        getFacetedMethod().debugData(debugString);
        return debugString.toString();
    }
View Full Code Here

    // debug, toString
    // /////////////////////////////////////////////////////////////

    @Override
    public String debugData() {
        final DebugString debugString = new DebugString();
        debugString.indent();
        debugString.indent();
        getFacetedMethod().debugData(debugString);
        return debugString.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.debug.DebugString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.