Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.AttributesImpl.clear()


                dumpLocation(loc, attr, handler);

                if (current instanceof MultiLocatable) {
                    List locations = ((MultiLocatable) current).getLocations();
                    for (int i = 1; i < locations.size(); i++) { // start at 1 because we already dumped the first one
                        attr.clear();
                        dumpLocation((Location) locations.get(i), attr, handler);
                    }
                }
                handler.endElement(EXCEPTION_NS, "locations", "ex:locations");
                handler.endElement(EXCEPTION_NS, "exception", "ex:exception");
View Full Code Here


            }
        }
        handler.endElement(EXCEPTION_NS, "cocoon-stacktrace", "ex:cocoon-stacktrace");

        // Root cause exception stacktrace
        attr.clear();
        simpleElement("stacktrace", attr, ExceptionUtils.getStackTrace(cause), handler);

        // Full stack trace (if exception is chained)
        if (thr != cause) {
            String trace = SystemUtils.isJavaVersionAtLeast(140) ?
View Full Code Here

                // loop over all tabs
                for (int j = 0; j < tabLayout.getSize(); j++) {
                    NamedItem tab = (NamedItem) tabLayout.getItem(j);

                    // open named-item tag
                    attributes.clear();
                    attributes.addCDATAAttribute("name", String.valueOf(tab.getName()));
                    if (j == selected) {
                        attributes.addCDATAAttribute("selected", "true");
                    } else {
                        ChangeAspectDataEvent event = new ChangeAspectDataEvent(tabLayout, "tab", new Integer(j));
View Full Code Here

            // loop over all tabs
            for (int j = 0; j < tabLayout.getSize(); j++) {
                Item tab = tabLayout.getItem(j);

                // open named-item tag
                attributes.clear();
                if (tab instanceof NamedItem) {
                    if (!subNav && !config.childTagName.equals("")) {
                        XMLUtils.startElement(handler, config.childTagName);
                        subNav = true;
                    }
View Full Code Here

            // start <response>
            AttributesImpl atts = new AttributesImpl();
            atts.addCDATAAttribute(TARGET_ATTR, m_target);
            atts.addCDATAAttribute(METHOD_ATTR, m_method);
            super.contentHandler.startElement(NS_URI, RESPONSE_TAG, NS_PREFIX + RESPONSE_TAG, atts);
            atts.clear();
           
            // <status>
            atts.addCDATAAttribute(CODE_ATTR, String.valueOf(method.getStatusCode()));
            atts.addCDATAAttribute(MSG_ATTR, method.getStatusText());
            super.contentHandler.startElement(NS_URI, STATUS_TAG, NS_PREFIX + STATUS_TAG, atts);
View Full Code Here

           
            // <status>
            atts.addCDATAAttribute(CODE_ATTR, String.valueOf(method.getStatusCode()));
            atts.addCDATAAttribute(MSG_ATTR, method.getStatusText());
            super.contentHandler.startElement(NS_URI, STATUS_TAG, NS_PREFIX + STATUS_TAG, atts);
            atts.clear();
            super.contentHandler.endElement(NS_URI, STATUS_TAG, NS_PREFIX + STATUS_TAG);
           
            // <header>s
            Header[] headers = method.getResponseHeaders();
            for (int i = 0; i < headers.length; i++) {
View Full Code Here

            Header[] headers = method.getResponseHeaders();
            for (int i = 0; i < headers.length; i++) {
                atts.addCDATAAttribute(NAME_ATTR, headers[i].getName());
                atts.addCDATAAttribute(VALUE_ATTR, headers[i].getValue());
                super.contentHandler.startElement(NS_URI, HEADER_TAG, NS_PREFIX + HEADER_TAG, atts);
                atts.clear();
                super.contentHandler.endElement(NS_URI, HEADER_TAG, NS_PREFIX + HEADER_TAG);
            }
           
            // response <body>
            final InputStream in = method.getResponseBodyAsStream();
View Full Code Here

        handler.startElement(EXCEPTION_NS, "exception-report", "ex:exception-report", attr);
       
        // Root exception location
        Location loc = LocationUtils.getLocation(root);       
        if (LocationUtils.isKnown(loc)) {
            attr.clear();
            dumpLocation(loc, attr, handler);
        }

        // Root exception message
        attr.clear();
View Full Code Here

            attr.clear();
            dumpLocation(loc, attr, handler);
        }

        // Root exception message
        attr.clear();
        String message = root instanceof LocatableException ? ((LocatableException)root).getRawMessage() : root.getMessage();
        simpleElement("message", attr, message, handler);
       
        // Cocoon stacktrace: dump all located exceptions in the exception stack
        handler.startElement(EXCEPTION_NS, "cocoon-stacktrace", "ex:cocoon-stacktrace", attr);
View Full Code Here

                handler.startElement(EXCEPTION_NS, "exception", "ex:exception", attr);
               
                message = current instanceof LocatableException ? ((LocatableException)current).getRawMessage() : current.getMessage();
                simpleElement("message", attr, message, handler);

                attr.clear();
                handler.startElement(EXCEPTION_NS, "locations", "ex:locations", attr);
                dumpLocation(loc, attr, handler);
               
                if (current instanceof MultiLocatable) {
                    List locations = ((MultiLocatable)current).getLocations();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.