Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/ls/DOMImplementationLS.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;4243import org.w3c.dom.DOMException;4445/**46* <code>DOMImplementationLS</code> contains the factory methods for creating47* Load and Save objects.48* <p> The expectation is that an instance of the49* <code>DOMImplementationLS</code> interface can be obtained by using50* binding-specific casting methods on an instance of the51* <code>DOMImplementation</code> interface or, if the <code>Document</code>52* supports the feature <code>"Core"</code> version <code>"3.0"</code>53* defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]54* , by using the method <code>DOMImplementation.getFeature</code> with55* parameter values <code>"LS"</code> (or <code>"LS-Async"</code>) and56* <code>"3.0"</code> (respectively).57* <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load58and Save Specification</a>.59*/60public interface DOMImplementationLS {61// DOMImplementationLSMode62/**63* Create a synchronous <code>LSParser</code>.64*/65public static final short MODE_SYNCHRONOUS = 1;66/**67* Create an asynchronous <code>LSParser</code>.68*/69public static final short MODE_ASYNCHRONOUS = 2;7071/**72* Create a new <code>LSParser</code>. The newly constructed parser may73* then be configured by means of its <code>DOMConfiguration</code>74* object, and used to parse documents by means of its <code>parse</code>75* method.76* @param mode The <code>mode</code> argument is either77* <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if78* <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the79* <code>LSParser</code> that is created will operate in synchronous80* mode, if it's <code>MODE_ASYNCHRONOUS</code> then the81* <code>LSParser</code> that is created will operate in asynchronous82* mode.83* @param schemaType An absolute URI representing the type of the schema84* language used during the load of a <code>Document</code> using the85* newly created <code>LSParser</code>. Note that no lexical checking86* is done on the absolute URI. In order to create a87* <code>LSParser</code> for any kind of schema types (i.e. the88* LSParser will be free to use any schema found), use the value89* <code>null</code>.90* <p ><b>Note:</b> For W3C XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]91* , applications must use the value92* <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>],93* applications must use the value94* <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages95* are outside the scope of the W3C and therefore should recommend an96* absolute URI in order to use this method.97* @return The newly created <code>LSParser</code> object. This98* <code>LSParser</code> is either synchronous or asynchronous99* depending on the value of the <code>mode</code> argument.100* <p ><b>Note:</b> By default, the newly created <code>LSParser</code>101* does not contain a <code>DOMErrorHandler</code>, i.e. the value of102* the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>103* error-handler</a>" configuration parameter is <code>null</code>. However, implementations104* may provide a default error handler at creation time. In that case,105* the initial value of the <code>"error-handler"</code> configuration106* parameter on the new <code>LSParser</code> object contains a107* reference to the default error handler.108* @exception DOMException109* NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is110* not supported.111*/112public LSParser createLSParser(short mode,113String schemaType)114throws DOMException;115116/**117* Create a new <code>LSSerializer</code> object.118* @return The newly created <code>LSSerializer</code> object.119* <p ><b>Note:</b> By default, the newly created120* <code>LSSerializer</code> has no <code>DOMErrorHandler</code>, i.e.121* the value of the <code>"error-handler"</code> configuration122* parameter is <code>null</code>. However, implementations may123* provide a default error handler at creation time. In that case, the124* initial value of the <code>"error-handler"</code> configuration125* parameter on the new <code>LSSerializer</code> object contains a126* reference to the default error handler.127*/128public LSSerializer createLSSerializer();129130/**131* Create a new empty input source object where132* <code>LSInput.characterStream</code>, <code>LSInput.byteStream</code>133* , <code>LSInput.stringData</code> <code>LSInput.systemId</code>,134* <code>LSInput.publicId</code>, <code>LSInput.baseURI</code>, and135* <code>LSInput.encoding</code> are null, and136* <code>LSInput.certifiedText</code> is false.137* @return The newly created input object.138*/139public LSInput createLSInput();140141/**142* Create a new empty output destination object where143* <code>LSOutput.characterStream</code>,144* <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,145* <code>LSOutput.encoding</code> are null.146* @return The newly created output object.147*/148public LSOutput createLSOutput();149150}151152153