34 * Informatics and Mathematics, Keio University). All Rights Reserved. This 35 * work is distributed under the W3C(r) Software License [1] in the hope that 36 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 37 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 38 * 39 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 40 */ 41 42 package org.w3c.dom.ls; 43 44 import org.w3c.dom.DOMException; 45 46 /** 47 * <code>DOMImplementationLS</code> contains the factory methods for creating 48 * Load and Save objects. 49 * <p> The expectation is that an instance of the 50 * <code>DOMImplementationLS</code> interface can be obtained by using 51 * binding-specific casting methods on an instance of the 52 * <code>DOMImplementation</code> interface or, if the <code>Document</code> 53 * supports the feature <code>"Core"</code> version <code>"3.0"</code> 54 * defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>] 55 * , by using the method <code>DOMImplementation.getFeature</code> with 56 * parameter values <code>"LS"</code> (or <code>"LS-Async"</code>) and 57 * <code>"3.0"</code> (respectively). 58 * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load 59 and Save Specification</a>. 60 * 61 * @since 1.5 62 */ 63 public interface DOMImplementationLS { 64 // DOMImplementationLSMode 65 /** 66 * Create a synchronous <code>LSParser</code>. 67 */ 68 public static final short MODE_SYNCHRONOUS = 1; 69 /** 70 * Create an asynchronous <code>LSParser</code>. 71 */ 72 public static final short MODE_ASYNCHRONOUS = 2; 73 74 /** 75 * Create a new <code>LSParser</code>. The newly constructed parser may 76 * then be configured by means of its <code>DOMConfiguration</code> 77 * object, and used to parse documents by means of its <code>parse</code> 78 * method. 79 * @param mode The <code>mode</code> argument is either 80 * <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if 81 * <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the 82 * <code>LSParser</code> that is created will operate in synchronous 83 * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the 84 * <code>LSParser</code> that is created will operate in asynchronous 85 * mode. 86 * @param schemaType An absolute URI representing the type of the schema 87 * language used during the load of a <code>Document</code> using the 88 * newly created <code>LSParser</code>. Note that no lexical checking 89 * is done on the absolute URI. In order to create a 90 * <code>LSParser</code> for any kind of schema types (i.e. the 91 * LSParser will be free to use any schema found), use the value 92 * <code>null</code>. 93 * <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>] 94 * , applications must use the value 95 * <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>], 96 * applications must use the value 97 * <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages 98 * are outside the scope of the W3C and therefore should recommend an 99 * absolute URI in order to use this method. 100 * @return The newly created <code>LSParser</code> object. This 101 * <code>LSParser</code> is either synchronous or asynchronous 102 * depending on the value of the <code>mode</code> argument. 103 * <p ><b>Note:</b> By default, the newly created <code>LSParser</code> 104 * does not contain a <code>DOMErrorHandler</code>, i.e. the value of 105 * the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'> 106 * error-handler</a>" configuration parameter is <code>null</code>. However, implementations 107 * may provide a default error handler at creation time. In that case, 108 * the initial value of the <code>"error-handler"</code> configuration 109 * parameter on the new <code>LSParser</code> object contains a 110 * reference to the default error handler. 111 * @exception DOMException 112 * NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is 113 * not supported. 114 */ 115 public LSParser createLSParser(short mode, 116 String schemaType) 117 throws DOMException; 118 119 /** 120 * Create a new <code>LSSerializer</code> object. 121 * @return The newly created <code>LSSerializer</code> object. 122 * <p ><b>Note:</b> By default, the newly created 123 * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>, i.e. 124 * the value of the <code>"error-handler"</code> configuration 125 * parameter is <code>null</code>. However, implementations may 126 * provide a default error handler at creation time. In that case, the | 34 * Informatics and Mathematics, Keio University). All Rights Reserved. This 35 * work is distributed under the W3C(r) Software License [1] in the hope that 36 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 37 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 38 * 39 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 40 */ 41 42 package org.w3c.dom.ls; 43 44 import org.w3c.dom.DOMException; 45 46 /** 47 * <code>DOMImplementationLS</code> contains the factory methods for creating 48 * Load and Save objects. 49 * <p> The expectation is that an instance of the 50 * <code>DOMImplementationLS</code> interface can be obtained by using 51 * binding-specific casting methods on an instance of the 52 * <code>DOMImplementation</code> interface or, if the <code>Document</code> 53 * supports the feature <code>"Core"</code> version <code>"3.0"</code> 54 * defined in 55 * [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>] 56 * , by using the method <code>DOMImplementation.getFeature</code> with 57 * parameter values <code>"LS"</code> (or <code>"LS-Async"</code>) and 58 * <code>"3.0"</code> (respectively). 59 * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'> 60 Document Object Model (DOM) Level 3 Load and Save Specification</a>. 61 * 62 * @since 1.5 63 */ 64 public interface DOMImplementationLS { 65 // DOMImplementationLSMode 66 /** 67 * Create a synchronous <code>LSParser</code>. 68 */ 69 public static final short MODE_SYNCHRONOUS = 1; 70 /** 71 * Create an asynchronous <code>LSParser</code>. 72 */ 73 public static final short MODE_ASYNCHRONOUS = 2; 74 75 /** 76 * Create a new <code>LSParser</code>. The newly constructed parser may 77 * then be configured by means of its <code>DOMConfiguration</code> 78 * object, and used to parse documents by means of its <code>parse</code> 79 * method. 80 * @param mode The <code>mode</code> argument is either 81 * <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if 82 * <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the 83 * <code>LSParser</code> that is created will operate in synchronous 84 * mode, if it's <code>MODE_ASYNCHRONOUS</code> then the 85 * <code>LSParser</code> that is created will operate in asynchronous 86 * mode. 87 * @param schemaType An absolute URI representing the type of the schema 88 * language used during the load of a <code>Document</code> using the 89 * newly created <code>LSParser</code>. Note that no lexical checking 90 * is done on the absolute URI. In order to create a 91 * <code>LSParser</code> for any kind of schema types (i.e. the 92 * LSParser will be free to use any schema found), use the value 93 * <code>null</code>. 94 * <p ><b>Note:</b> For W3C XML Schema 95 * [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>] 96 * , applications must use the value 97 * <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD 98 * [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], 99 * applications must use the value 100 * <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages 101 * are outside the scope of the W3C and therefore should recommend an 102 * absolute URI in order to use this method. 103 * @return The newly created <code>LSParser</code> object. This 104 * <code>LSParser</code> is either synchronous or asynchronous 105 * depending on the value of the <code>mode</code> argument. 106 * <p ><b>Note:</b> By default, the newly created <code>LSParser</code> 107 * does not contain a <code>DOMErrorHandler</code>, i.e. the value of 108 * the "<a href='https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#parameter-error-handler'>error-handler</a>" 109 * configuration parameter is <code>null</code>. However, implementations 110 * may provide a default error handler at creation time. In that case, 111 * the initial value of the <code>"error-handler"</code> configuration 112 * parameter on the new <code>LSParser</code> object contains a 113 * reference to the default error handler. 114 * @exception DOMException 115 * NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is 116 * not supported. 117 */ 118 public LSParser createLSParser(short mode, 119 String schemaType) 120 throws DOMException; 121 122 /** 123 * Create a new <code>LSSerializer</code> object. 124 * @return The newly created <code>LSSerializer</code> object. 125 * <p ><b>Note:</b> By default, the newly created 126 * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>, i.e. 127 * the value of the <code>"error-handler"</code> configuration 128 * parameter is <code>null</code>. However, implementations may 129 * provide a default error handler at creation time. In that case, the |