Package org.apache.cocoon.sitemap.xml

Examples of org.apache.cocoon.sitemap.xml.AttributesImpl


            throw new RuntimeException("Failed to generate exception document.", e);
        }
    }

    private void toSAX(Throwable throwable, ContentHandler handler) throws SAXException {
        AttributesImpl attr = new AttributesImpl();
        // handler.startPrefixMapping("ex", EXCEPTION_NS);
        attr.addCDATAAttribute("class", throwable.getClass().getName());
        attr.addCDATAAttribute("timestamp", this.dateFormat.format(new Date()));
        handler.startElement(EXCEPTION_NS, "exception-report", "exception-report", attr);
        // handler.startElement(EXCEPTION_NS, "exception-report", "ex:exception-report", attr);

        // exception message
        attr.clear();
        simpleElement("message", attr, throwable.getMessage(), handler);

        // exception stacktrace
        attr.clear();
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw, true);
        throwable.printStackTrace(pw);
        simpleElement("stacktrace", attr, sw.getBuffer().toString(), handler);
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sitemap.xml.AttributesImpl

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.