Package org.apache.cocoon.xml

Examples of org.apache.cocoon.xml.ContentHandlerWrapper


            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // for clean environment stack handling.
                CocoonComponentManager.enterEnvironment(this.environment,
                                                        this.manager,
View Full Code Here


       try {
           deserializer = (XMLDeserializer) this.manager.lookup(XMLDeserializer.ROLE);
           if ( contentHandler instanceof XMLConsumer) {
               deserializer.setConsumer((XMLConsumer)contentHandler);
           } else {
               deserializer.setConsumer(new ContentHandlerWrapper(contentHandler));
           }
           deserializer.deserialize( this.cachedResponse.getAlternativeResponse() );
       } catch (ServiceException se ) {
           throw new SAXException("Unable to lookup xml deserializer.", se);
       } finally {
View Full Code Here

                    deserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    if ( contentHandler instanceof XMLConsumer ) {
                        deserializer.setConsumer( (XMLConsumer)contentHandler );
                    } else {
                        LexicalHandler lh = (contentHandler instanceof LexicalHandler ? (LexicalHandler)contentHandler : null);
                        deserializer.setConsumernew ContentHandlerWrapper(contentHandler, lh));
                    }
                    deserializer.deserialize( data );
                } catch (ServiceException ce) {
                    throw new SAXException("Unable to lookup xml deserializer.", ce);
                } finally {
View Full Code Here

       try {
           deserializer = (XMLDeserializer) this.manager.lookup(XMLDeserializer.ROLE);
           if ( contentHandler instanceof XMLConsumer) {
               deserializer.setConsumer((XMLConsumer)contentHandler);
           } else {
               deserializer.setConsumer(new ContentHandlerWrapper(contentHandler));
           }
           deserializer.deserialize( this.cachedResponse.getAlternativeResponse() );
       } catch (ServiceException se ) {
           throw new SAXException("Unable to lookup xml deserializer.", se);
       } finally {
View Full Code Here

            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // clean environment stack handling.
                EnvironmentStack envStack = CocoonComponentManager.getCurrentEnvironmentStack();
                int currentOffset = envStack.getOffset();
View Full Code Here

            } else {
              XMLConsumer consumer;
              if (contentHandler instanceof XMLConsumer) {
                  consumer = (XMLConsumer)contentHandler;
              } else if (contentHandler instanceof LexicalHandler) {
                  consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
              } else {
                  consumer = new ContentHandlerWrapper(contentHandler);
              }
                // We have to add an environment changer
                // clean environment stack handling.
                EnvironmentStack envStack = CocoonComponentManager.getCurrentEnvironmentStack();
                int currentOffset = envStack.getOffset();
View Full Code Here

        try {
            XMLByteStreamInterpreter deserializer = new XMLByteStreamInterpreter();
            if (contentHandler instanceof XMLConsumer) {
                deserializer.setConsumer((XMLConsumer) contentHandler);
            } else {
                deserializer.setConsumer(new ContentHandlerWrapper(contentHandler));
            }
            deserializer.deserialize(getXMLResponse());
        } catch (CascadingIOException e) {
            throw new SAXException(e.getMessage(), (Exception) e.getCause());
        } catch (IOException e) {
View Full Code Here

            } else {
                XMLConsumer consumer;
                if (contentHandler instanceof XMLConsumer) {
                    consumer = (XMLConsumer)contentHandler;
                } else if (contentHandler instanceof LexicalHandler) {
                    consumer = new ContentHandlerWrapper(contentHandler, (LexicalHandler)contentHandler);
                } else {
                    consumer = new ContentHandlerWrapper(contentHandler);
                }
                // We have to add an environment changer
                // for clean environment stack handling.
                EnvironmentHelper.enterProcessor(this.pipelineDescription.processor,
                                                 this.environment);
View Full Code Here

        try {
            XMLByteStreamInterpreter deserializer = new XMLByteStreamInterpreter();
            if (contentHandler instanceof XMLConsumer) {
                deserializer.setConsumer((XMLConsumer) contentHandler);
            } else {
                deserializer.setConsumer(new ContentHandlerWrapper(contentHandler));
            }
            deserializer.deserialize(getXMLResponse());
        } catch (CascadingIOException e) {
            throw new SAXException(e.getMessage(), (Exception) e.getCause());
        } catch (IOException e) {
View Full Code Here

        FileSavingEnvironment env =
            new FileSavingEnvironment(deparameterizedURI, lastModified, context,
                                      null, parameters, links,
                                      gatheredLinks, cliContext, null, log);

        XMLConsumer consumer = new ContentHandlerWrapper(handler);
        ProcessingPipeline pipeline = cocoon.buildPipeline(env);
        CocoonComponentManager.enterEnvironment(env, cocoon.getComponentManager(), cocoon);
        try {
            pipeline.prepareInternal(env);
            pipeline.process(env, consumer);
View Full Code Here

TOP

Related Classes of org.apache.cocoon.xml.ContentHandlerWrapper

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.