All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.magicwerk.brownies.jdom.XmlResult Maven / Gradle / Ivy

There is a newer version: 0.9.17
Show newest version
/*
 * Copyright 2013 by Thomas Mauch
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * $Id$
 */
package org.magicwerk.brownies.jdom;

import javax.xml.transform.stream.StreamResult;

import org.magicwerk.brownies.jdom.XmlProcessor.Validation;

/**
 * Specification of result for XML processing.
 *
 * @author Thomas Mauch
 * @version $Id$
 */
public class XmlResult {
	private StreamResult streamResult;
	private Validation validation;
	private String schemaUrl;

    /**
     * Constructor to specify result of XML processing.
     *
     * @param resultFile	file to receive processing result
     * @param validation	validation mode
     */
    public XmlResult(String resultFile, Validation validation)  {
    	this(new StreamResult(resultFile), validation, null);
    }

    /**
     * Constructor to specify result of XML processing.
     *
     * @param streamResult	processing result
     * @param validation	validation mode
     */
    public XmlResult(StreamResult streamResult, Validation validation) {
    	this(streamResult, validation, null);
    }

    /**
     * Constructor to specify result of XML processing.
     *
     * @param resultFile	file to receive processing result
     * @param schemaUrl		XSD schema URL
     */
    public XmlResult(String resultFile, String schemaUrl) {
    	this(new StreamResult(resultFile), Validation.XSD, schemaUrl);
    }

    /**
     * Constructor to specify result of XML processing.
     *
     * @param streamResult	processing result
     * @param schemaUrl 	XSD schema URL
     */
    public XmlResult(StreamResult streamResult, String schemaUrl) {
    	this(streamResult, Validation.XSD, schemaUrl);
    }

    /**
     * Constructor to specify result of XML processing.

     * @param streamResult	processing result
     * @param validation	validation mode
     * @param schemaUrl		XSD schema URL
     */
    public XmlResult(StreamResult streamResult, Validation validation, String schemaUrl) {
    	this.streamResult = streamResult;
    	this.validation = validation;
    	this.schemaUrl = schemaUrl;
    }

	/**
	 * @return the inputSource
	 */
	public StreamResult getStreamResult() {
		return streamResult;
	}

	/**
	 * @return the validation
	 */
	public Validation getValidation() {
		return validation;
	}

	/**
	 * @return the schemaFile
	 */
	public String getSchemaUrl() {
		return schemaUrl;
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy