3261N/A * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. 829N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 829N/A * This code is free software; you can redistribute it and/or modify it 829N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 829N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 829N/A * This code is distributed in the hope that it will be useful, but WITHOUT 829N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 829N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 829N/A * version 2 for more details (a copy is included in the LICENSE file that 829N/A * accompanied this code). 829N/A * You should have received a copy of the GNU General Public License version 829N/A * 2 along with this work; if not, write to the Free Software Foundation, 829N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 829N/A * <p>Acts as an holder for a transformation result, 829N/A * which may be XML, plain Text, HTML, or some other form of markup.</p> 829N/A * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a> 829N/A * returns true when passed this value as an argument, 829N/A * the Transformer supports Result output of this type. 829N/A * Zero-argument default constructor. 829N/A * Construct a StreamResult from a byte stream. Normally, 829N/A * a stream should be used rather than a reader, so that 2713N/A * the transformer may use instructions contained in the 829N/A * transformation instructions to control the encoding. 829N/A * @param outputStream A valid OutputStream reference. 829N/A * Construct a StreamResult from a character stream. Normally, 829N/A * a stream should be used rather than a reader, so that 829N/A * the transformer may use instructions contained in the 829N/A * transformation instructions to control the encoding. However, 829N/A * there are times when it is useful to write to a character 829N/A * stream, such as when using a StringWriter. 829N/A * @param writer A valid Writer reference. * Construct a StreamResult from a URL. * @param systemId Must be a String that conforms to the URI syntax. * Construct a StreamResult from a File. * @param f Must a non-null File reference. //convert file to appropriate URI, f.toURI().toASCIIString() //converts the URI to string as per rule specified in * Set the ByteStream that is to be written to. Normally, * a stream should be used rather than a reader, so that * the transformer may use instructions contained in the * transformation instructions to control the encoding. * @param outputStream A valid OutputStream reference. * Get the byte stream that was set with setOutputStream. * @return The byte stream that was set with setOutputStream, or null * if setOutputStream or the ByteStream constructor was not called. * Set the writer that is to receive the result. Normally, * a stream should be used rather than a writer, so that * the transformer may use instructions contained in the * transformation instructions to control the encoding. However, * there are times when it is useful to write to a writer, * such as when using a StringWriter. * @param writer A valid Writer reference. * Get the character stream that was set with setWriter. * @return The character stream that was set with setWriter, or null * if setWriter or the Writer constructor was not called. * Set the systemID that may be used in association * with the byte or character stream, or, if neither is set, use * this value as a writeable URI (probably a file name). * @param systemId The system identifier as a URI string. * <p>Set the system ID from a <code>File</code> reference.</p> * @param f Must a non-null File reference. //convert file to appropriate URI, f.toURI().toASCIIString() //converts the URI to string as per rule specified in * Get the system identifier that was set with setSystemId. * @return The system identifier that was set with setSystemId, or null * if setSystemId was not called. ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// * The systemID that may be used in association * with the byte or character stream, or, if neither is set, use * this value as a writeable URI (probably a file name). * The byte stream that is to be written to. * The character stream that is to be written to.