Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/ls/LSOutput.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2004 World Wide Web Consortium,31*32* (Massachusetts Institute of Technology, European Research Consortium for33* Informatics and Mathematics, Keio University). All Rights Reserved. This34* work is distributed under the W3C(r) Software License [1] in the hope that35* it will be useful, but WITHOUT ANY WARRANTY; without even the implied36* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.37*38* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-2002123139*/4041package org.w3c.dom.ls;4243/**44* This interface represents an output destination for data.45* <p> This interface allows an application to encapsulate information about46* an output destination in a single object, which may include a URI, a byte47* stream (possibly with a specified encoding), a base URI, and/or a48* character stream.49* <p> The exact definitions of a byte stream and a character stream are50* binding dependent.51* <p> The application is expected to provide objects that implement this52* interface whenever such objects are needed. The application can either53* provide its own objects that implement this interface, or it can use the54* generic factory method <code>DOMImplementationLS.createLSOutput()</code>55* to create objects that implement this interface.56* <p> The <code>LSSerializer</code> will use the <code>LSOutput</code> object57* to determine where to serialize the output to. The58* <code>LSSerializer</code> will look at the different outputs specified in59* the <code>LSOutput</code> in the following order to know which one to60* output to, the first one that is not null and not an empty string will be61* used:62* <ol>63* <li> <code>LSOutput.characterStream</code>64* </li>65* <li>66* <code>LSOutput.byteStream</code>67* </li>68* <li> <code>LSOutput.systemId</code>69* </li>70* </ol>71* <p> <code>LSOutput</code> objects belong to the application. The DOM72* implementation will never modify them (though it may make copies and73* modify the copies, if necessary).74* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load75and Save Specification</a>.76*/77public interface LSOutput {78/**79* An attribute of a language and binding dependent type that represents80* a writable stream to which 16-bit units can be output.81*/82public java.io.Writer getCharacterStream();83/**84* An attribute of a language and binding dependent type that represents85* a writable stream to which 16-bit units can be output.86*/87public void setCharacterStream(java.io.Writer characterStream);8889/**90* An attribute of a language and binding dependent type that represents91* a writable stream of bytes.92*/93public java.io.OutputStream getByteStream();94/**95* An attribute of a language and binding dependent type that represents96* a writable stream of bytes.97*/98public void setByteStream(java.io.OutputStream byteStream);99100/**101* The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this102* output destination.103* <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the104* behavior is implementation dependent.105*/106public String getSystemId();107/**108* The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], for this109* output destination.110* <br> If the system ID is a relative URI reference (see section 5 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the111* behavior is implementation dependent.112*/113public void setSystemId(String systemId);114115/**116* The character encoding to use for the output. The encoding must be a117* string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section118* 4.3.3 "Character Encoding in Entities"), it is recommended that119* character encodings registered (as charsets) with the Internet120* Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]121* should be referred to using their registered names.122*/123public String getEncoding();124/**125* The character encoding to use for the output. The encoding must be a126* string acceptable for an XML encoding declaration ([<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>] section127* 4.3.3 "Character Encoding in Entities"), it is recommended that128* character encodings registered (as charsets) with the Internet129* Assigned Numbers Authority [<a href='ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets'>IANA-CHARSETS</a>]130* should be referred to using their registered names.131*/132public void setEncoding(String encoding);133134}135136137