Package org.apache.cocoon.pipeline

Examples of org.apache.cocoon.pipeline.SetupException


    public void setConsumer(Consumer consumer) {
        if (consumer instanceof StAXConsumer) {
            this.consumer = (StAXConsumer) consumer;
            this.consumer.setParent(this);
        } else {
            throw new SetupException("StAXProducer requires an StAXConsumer.");
        }
    }
View Full Code Here


     *            this may be changed later.
     */
    public SAXForStAXPipelineWrapper(SAXProducer saxTransformer) {
        // check if component is the right one
        if (!(saxTransformer instanceof SAXConsumer)) {
            throw new SetupException("SAX component does not fulfill all preconditions.");
        }

        this.saxTransformer = saxTransformer;
    }
View Full Code Here

     */
    public XMLGenerator(InputStream inputStream) {
        try {
            this.reader = XMLInputFactory.newInstance().createXMLEventReader(inputStream);
        } catch (XMLStreamException e) {
            throw new SetupException("Error during setup an XMLEventReader on the inputStream", e);
        } catch (FactoryConfigurationError e) {
            throw new SetupException("Error during setup the XMLInputFactory for creating an XMLEventReader", e);
        }
    }
View Full Code Here

     */
    public void setOutputStream(OutputStream outputStream) {
        try {
            this.writer = XMLOutputFactory.newInstance().createXMLEventWriter(outputStream, "UTF-8");
        } catch (XMLStreamException e) {
            throw new SetupException("Error during setup an XMLEventWriter on the outputStream", e);
        } catch (FactoryConfigurationError e) {
            throw new SetupException("Error during setup the XMLOutputFactory for creating an XMLEventWriter", e);
        }
    }
View Full Code Here

    public XMLSerializer(Properties format) {
        super();

        if (format == null) {
            throw new SetupException("No format properites passed as argument.");
        }

        this.format = format;
    }
View Full Code Here

        return parameterCacheKey;
    }

    public XMLSerializer setCDataSectionElements(String cdataSectionElements) {
        if (cdataSectionElements == null || EMPTY.equals(cdataSectionElements)) {
            throw new SetupException("A ... has to be passed as argument.");
        }

        this.format.put(OutputKeys.CDATA_SECTION_ELEMENTS, cdataSectionElements);
        return this;
    }
View Full Code Here

        return this;
    }

    public XMLSerializer setDoctypePublic(String doctypePublic) {
        if (doctypePublic == null || EMPTY.equals(doctypePublic)) {
            throw new SetupException("A doctype-public has to be passed as argument.");
        }

        this.format.put(OutputKeys.DOCTYPE_PUBLIC, doctypePublic);
        return this;
    }
View Full Code Here

        return this;
    }

    public XMLSerializer setDoctypeSystem(String doctypeSystem) {
        if (doctypeSystem == null || EMPTY.equals(doctypeSystem)) {
            throw new SetupException("A doctype-system has to be passed as argument.");
        }

        this.format.put(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem);
        return this;
    }
View Full Code Here

        return this;
    }

    public XMLSerializer setEncoding(String encoding) {
        if (encoding == null || EMPTY.equals(encoding)) {
            throw new SetupException("A encoding has to be passed as argument.");
        }

        this.format.put(OutputKeys.ENCODING, encoding);
        return this;
    }
View Full Code Here

        return this;
    }

    public XMLSerializer setMediaType(String mediaType) {
        if (mediaType == null || EMPTY.equals(mediaType)) {
            throw new SetupException("A media-type has to be passed as argument.");
        }

        this.format.put(OutputKeys.MEDIA_TYPE, mediaType);
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.pipeline.SetupException

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.