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

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


    /**
     * @see #specification(ObjectAdapter, DebugBuilder)
     * @see #specification(ObjectSpecification, DebugBuilder)
     */
    public static String specification(final ObjectAdapter adapter) {
        final DebugBuilder debugBuilder = new DebugString();
        specification(adapter, debugBuilder);
        return debugBuilder.toString();
    }
View Full Code Here


    /**
     * @see #adapter(ObjectAdapter, DebugBuilder)
     */
    public static String adapter(final ObjectAdapter adapter) {
        final DebugBuilder debugBuilder = new DebugString();
        adapter(adapter, debugBuilder);
        return debugBuilder.toString();
    }
View Full Code Here

    public void test() {
        final ObjectSpecification specification =
            IsisContext.getSpecificationLoader().loadSpecification(ExampleReferencePojo.class);
        final ObjectAdapter object = IsisContext.getPersistenceSession().createInstance(specification);

        final DebugBuilder debug = new DebugString();
        IsisContext.getPersistenceSession().debugData(debug);
        IsisContext.getSpecificationLoader().debugData(debug);
        /*
         * System.out.println(debug);
         *
 
View Full Code Here

    @Override
    public void open() {
        Sql.setMetaData(connectionPool.acquire().getMetaData());

        final DebugBuilder debug = new DebugString();
        connectionPool.debug(debug);
        LOG.info("Database: " + debug);

        objectMappingLookup.init();
View Full Code Here

    private void prepareErrorDetails(final Throwable exception, final RequestContext requestContext,
        final String errorRef, final String servletPath) {
        final DebugString debugText = new DebugString();
        final DebugHtmlString debugHtml = new DebugHtmlString();
        final DebugBuilder debug = new DebugTee(debugText, debugHtml);

        try {
            debug.startSection("Exception");
            debug.appendException(exception);
            debug.endSection();
        } catch (final RuntimeException e) {
            debug.appendln("NOTE - an exception occurred while dumping an exception!");
            debug.appendException(e);
        }

        if (IsisContext.getCurrentTransaction() != null) {
            final List<String> messages = IsisContext.getMessageBroker().getMessages();
            final List<String> warnings = IsisContext.getMessageBroker().getWarnings();
            if (messages.size() > 0 || messages.size() > 0) {
                debug.startSection("Warnings/Messages");
                for (final String message : messages) {
                    debug.appendln("message", message);
                }
                for (final String message : warnings) {
                    debug.appendln("warning", message);
                }
            }
        }

        requestContext.append(debug);

        debug.startSection("Processing Trace");
        debug.appendPreformatted(requestContext.getDebugTrace());
        debug.endSection();
        debug.close();

        PrintWriter writer;
        try {
            final String directory =
                IsisContext.getConfiguration().getString(ConfigurationConstants.ROOT + "scimpi.error-snapshots", ".");
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

    private void specification(final Request request, final ObjectSpecification spec) {
        request.appendHtml("<h1>Specification - " + spec.getFullIdentifier() + "</h1>");
        request.appendHtml("<p><a href=\"./debug.shtml?type=specification-graph&value=" + spec.getFullIdentifier()
            + "\">Specification Graph</a></p>");
        final DebugBuilder debug = new DebugHtmlString();
        specification(spec, debug);
        request.appendHtml(debug.toString());
    }
View Full Code Here

        final ObjectSpecification spec = getSpecificationLoader().loadSpecification(name);
        request.appendHtml("<h1>Specification Graph - " + spec.getFullIdentifier() + "</h1>");
        request.appendHtml("<p><a href=\"./debug.shtml?type=specification&value=" + spec.getFullIdentifier()
            + "\">Full Specification</a></p>");
        request.appendHtml("<pre>");
        final DebugBuilder debug = new DebugString();
        debug.appendln(spec.getFullIdentifier());
        debug.indent();
        specificationGraph(spec, debug, new ArrayList<ObjectSpecification>());
        debug.unindent();
        request.appendHtml(debug.toString());
        request.appendHtml("</pre>");
    }
View Full Code Here

TOP

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

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.