Package org.apache.cocoon.pipeline

Examples of org.apache.cocoon.pipeline.SetupException


    @Override
    public void setup(Map<String, Object> inputParameters) {
        try {
            this.transformerHandler = SAX_TRANSFORMER_FACTORY.newTransformerHandler();
        } catch (TransformerConfigurationException e) {
            throw new SetupException("Can't setup transformer handler for the serializer.", e);
        }

        // set a default method because some transformer implementations run
        // into NPEs if it is missing
        if (!this.format.containsKey("format")) {
View Full Code Here


        this.setContentHandler(this.transformerHandler);
    }

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

        this.format.put(OutputKeys.VERSION, version);
        return this;
    }
View Full Code Here

        }

        try {
            this.schema = SCHEMA_FACTORY.newSchema(source);
        } catch (SAXException e) {
            throw new SetupException("Could not initialize xschema source", e);
        }

        this.source = source;
    }
View Full Code Here

     *
     * @see org.apache.cocoon.pipeline.component.Producer#setConsumer(org.apache.cocoon.pipeline.component.Consumer)
     */
    public final void setConsumer(Consumer consumer) {
        if (!(consumer instanceof SAXConsumer)) {
            throw new SetupException("SAXProducer requires a SAXConsumer.");
        }

        this.setSAXConsumer((SAXConsumer) consumer);
    }
View Full Code Here

            try {
                this.templates = transformerFactory.newTemplates(urlSource);
                // store the XSLT into the cache for future reuse
                XSLT_CACHE.put(this.source, this.templates);
            } catch (TransformerConfigurationException e) {
                throw new SetupException("Impossible to read XSLT from '"
                        + this.source.toExternalForm()
                        + "', see nested exception", e);
            }
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void setConfiguration(final Map<String, ? extends Object> configuration) {
        try {
            this.source = (URL) configuration.get("source");
        } catch (ClassCastException cce) {
            throw new SetupException("The configuration value of 'source' can't be cast to java.net.URL.", cce);
        }

        if (this.source != null) {
            Object attributesObj = configuration.get("attributes");
            if (attributesObj != null && attributesObj instanceof Map) {
View Full Code Here

    protected void setSAXConsumer(final SAXConsumer consumer) {
        TransformerHandler transformerHandler;
        try {
            transformerHandler = TRAX_FACTORY.newTransformerHandler(this.templates);
        } catch (Exception ex) {
            throw new SetupException("Could not initialize transformer handler.", ex);
        }

        if (this.parameters != null) {
            final Transformer transformer = transformerHandler.getTransformer();
View Full Code Here

    public void setConfiguration(Map<String, ? extends Object> configuration) {
        try {
            this.encoding = ConfigurationUtils.getEncoding(configuration);
            this.setEncoding(this.encoding);
        } catch (UnsupportedEncodingException e) {
            throw new SetupException(e);
        }

        try {
            this.indent = ConfigurationUtils.getIndent(configuration);
            this.setIndentPerLevel(this.indent);
        } catch (NumberFormatException nfe) {
            throw new SetupException(nfe);
        }

        this.docType = (String) configuration.get("doctype-default");
        this.setDoctypeDefault(this.docType);
    }
View Full Code Here

    @Override
    public void setOutputStream(OutputStream outputStream) {
        try {
            super.setOutputStream(outputStream);
        } catch (IOException e) {
            throw new SetupException(e);
        }
    }
View Full Code Here

    public void setConfiguration(Map<String, ? extends Object> configuration) {
        try {
            this.encoding = ConfigurationUtils.getEncoding(configuration);
            this.setEncoding(this.encoding);
        } catch (UnsupportedEncodingException e) {
            throw new SetupException(e);
        }

        try {
            this.indent = ConfigurationUtils.getIndent(configuration);
            this.setIndentPerLevel(this.indent);
        } catch (NumberFormatException nfe) {
            throw new SetupException(nfe);
        }

        this.omitXmlDeclaration = (String) configuration.get("omit-xml-declaration");
        this.setOmitXmlDeclaration(this.omitXmlDeclaration);
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.