Package org.apache.cocoon.xml

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


            // 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

                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 exception stacktrace
        attr.clear();
        simpleElement("stacktrace", attr, ExceptionUtils.getStackTrace(root), handler);
       
        // Full stack trace (if exception is chained)
        if (thr != root) {
            String trace = SystemUtils.isJavaVersionAtLeast(140) ?
View Full Code Here

        // END Memory status

        // BEGIN JRE
        startGroup("JRE");
        addValue("version", SystemUtils.JAVA_VERSION);
        atts.clear();
        // qName = prefix + ':' + localName
        atts.addAttribute(XLINK_NS, "type", XLINK_PREFIX + ":type", "CDATA", "simple");
        atts.addAttribute(XLINK_NS, "href", XLINK_PREFIX + ":href", "CDATA", SystemUtils.JAVA_VENDOR_URL);
        addValue("java-vendor", SystemUtils.JAVA_VENDOR, atts);
        endGroup();
View Full Code Here

            while (i.hasNext()) {
                Store store = (Store) i.next();
                startGroup(store.getClass().getName() + " (hash = 0x" + Integer.toHexString(store.hashCode()) + ")");
                int size = 0;
                int empty = 0;
                atts.clear();
                atts.addAttribute(NAMESPACE, "name", "name", "CDATA", "cached");
                super.contentHandler.startElement(NAMESPACE, "value", "value", atts);

                atts.clear();
                Enumeration e = store.keys();
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.