Package org.apache.cocoon.components.sax

Examples of org.apache.cocoon.components.sax.XMLByteStreamInterpreter


     * Generates SAX events for this ValidationError. In case of the constructors where
     * a String error message key was supplied, the necessary I18n tags will be generated.
     */
    public void generateSaxFragment(ContentHandler contentHandler) throws SAXException {
        if (saxFragment != null) {
            XMLByteStreamInterpreter byteStreamInterpreter = new XMLByteStreamInterpreter();
            byteStreamInterpreter.setContentHandler(contentHandler);
            byteStreamInterpreter.deserialize(saxFragment);
        } else if (errorMessageParameters != null) {
            contentHandler.startPrefixMapping("i18n", I18nTransformer.I18N_NAMESPACE_URI);

            contentHandler.startElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_TRANSLATE_ELEMENT, "i18n:" + I18nTransformer.I18N_TRANSLATE_ELEMENT, Constants.EMPTY_ATTRS);

View Full Code Here


                && (localName.equals("widget") || localName.equals("repeater-widget"))) {

            if (repeaterWidget) {
                Repeater repeater = (Repeater)widget;
                WidgetReplacingPipe rowPipe = new WidgetReplacingPipe();
                XMLByteStreamInterpreter interpreter = new XMLByteStreamInterpreter();
                int rowCount = repeater.getSize();
                Object saxFragment = xmlCompiler.getSAXFragment();
                for (int i = 0; i < rowCount; i++) {
                    Repeater.RepeaterRow row = repeater.getRow(i);
                    rowPipe.init(row);
                    rowPipe.setContentHandler(contentHandler);
                    rowPipe.setLexicalHandler(lexicalHandler);
                    interpreter.setConsumer(rowPipe);
                    interpreter.deserialize(saxFragment);
                    interpreter.recycle();
                    rowPipe.recycle();
                }
            } else {
                stylingHandler.recycle();
                stylingHandler.setSaxFragment(xmlCompiler.getSAXFragment());
View Full Code Here

    constraints = new ArrayList();
    constraintAliases = new HashMap();
    redirect = null;
    redirectLevel = 0;
    define = false;
    xmli = new XMLByteStreamInterpreter();
    xmli.setContentHandler(new EmbeddedXMLPipe(this));
  }
View Full Code Here

            super.streamContent(coplet, uri, bc);

            if ( coplet.getAttribute(DO_NOT_CACHE) != null ) {
                coplet.removeAttribute(DO_NOT_CACHE);
                this.setCacheInvalid(coplet);
                XMLByteStreamInterpreter bi = new XMLByteStreamInterpreter();
                bi.setContentHandler(contentHandler);

                bi.deserialize(bc.getSAXFragment());
            } else {
                this.toCache(coplet, bc.getSAXFragment());

                this.toSAXFromCache(coplet, contentHandler);
            }
View Full Code Here

     * @throws SAXException
     */
    private void toSAXFromCache(CopletInstanceData coplet,
                                ContentHandler contentHandler)
    throws SAXException {
        XMLByteStreamInterpreter bi = new XMLByteStreamInterpreter();
        bi.setContentHandler(contentHandler);

        bi.deserialize(coplet.getAttribute(CACHE));
    }
View Full Code Here

            super.streamContent(coplet, uri, bc);

            if ( coplet.getAttribute(DO_NOT_CACHE) != null ) {
                coplet.removeAttribute(DO_NOT_CACHE);
                this.setCacheInvalid(coplet);
                XMLByteStreamInterpreter bi = new XMLByteStreamInterpreter();
                bi.setContentHandler(contentHandler);

                bi.deserialize(bc.getSAXFragment());
            } else {
            this.toCache(coplet, bc.getSAXFragment());

            this.toSAXFromCache(coplet, contentHandler);
        }
View Full Code Here

     * @throws SAXException
     */
    private void toSAXFromCache(CopletInstanceData coplet,
                                ContentHandler contentHandler)
    throws SAXException {
        XMLByteStreamInterpreter bi = new XMLByteStreamInterpreter();
        bi.setContentHandler(contentHandler);

        bi.deserialize(coplet.getAttribute(CACHE));
    }
View Full Code Here

    public void setup(int index, ProfilerData data) {
        this.index = index;
        this.data = data;

        // FIXME Retrieve components from the CM
        this.deserializer = new XMLByteStreamInterpreter();
        this.serializer = new XMLByteStreamCompiler();
    }
View Full Code Here

     * Generates SAX events for this ValidationError. In case of the constructors where
     * a String error message key was supplied, the necessary I18n tags will be generated.
     */
    public void generateSaxFragment(ContentHandler contentHandler) throws SAXException {
        if (saxFragment != null) {
            XMLByteStreamInterpreter byteStreamInterpreter = new XMLByteStreamInterpreter();
            byteStreamInterpreter.setContentHandler(contentHandler);
            byteStreamInterpreter.deserialize(saxFragment);
        } else if (errorMessageParameters != null) {
            contentHandler.startPrefixMapping("i18n", I18nTransformer.I18N_NAMESPACE_URI);

            contentHandler.startElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_TRANSLATE_ELEMENT, "i18n:" + I18nTransformer.I18N_TRANSLATE_ELEMENT, Constants.EMPTY_ATTRS);

View Full Code Here

     * @throws SAXException
     */
    private void toSAXFromCache(CopletInstanceData coplet,
                                ContentHandler contentHandler)
    throws SAXException {
        XMLByteStreamInterpreter bi = new XMLByteStreamInterpreter();
        bi.setContentHandler(contentHandler);

        bi.deserialize(coplet.getAttribute(CACHE));
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.sax.XMLByteStreamInterpreter

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.