alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (DOMImplementationLS.java)

This example Java source code file (DOMImplementationLS.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

dom, domexception, domimplementationls, lsinput, lsoutput, lsparser, lsserializer, mode_asynchronous, mode_synchronous, string

The DOMImplementationLS.java Java example source code

/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

/*
 * This file is available under and governed by the GNU General Public
 * License version 2 only, as published by the Free Software Foundation.
 * However, the following notice accompanied the original version of this
 * file and, per its terms, should not be removed:
 *
 * Copyright (c) 2004 World Wide Web Consortium,
 *
 * (Massachusetts Institute of Technology, European Research Consortium for
 * Informatics and Mathematics, Keio University). All Rights Reserved. This
 * work is distributed under the W3C(r) Software License [1] in the hope that
 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
 */

package org.w3c.dom.ls;

import org.w3c.dom.DOMException;

/**
 *  <code>DOMImplementationLS contains the factory methods for creating
 * Load and Save objects.
 * <p> The expectation is that an instance of the
 * <code>DOMImplementationLS interface can be obtained by using
 * binding-specific casting methods on an instance of the
 * <code>DOMImplementation interface or, if the Document
 * supports the feature <code>"Core" version "3.0"
 * defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core]
 * , by using the method <code>DOMImplementation.getFeature with
 * parameter values <code>"LS" (or "LS-Async") and
 * <code>"3.0" (respectively).
 * <p>See also the Document Object Model (DOM) Level 3 Load
and Save Specification</a>.
 */
public interface DOMImplementationLS {
    // DOMImplementationLSMode
    /**
     * Create a synchronous <code>LSParser.
     */
    public static final short MODE_SYNCHRONOUS          = 1;
    /**
     * Create an asynchronous <code>LSParser.
     */
    public static final short MODE_ASYNCHRONOUS         = 2;

    /**
     * Create a new <code>LSParser. The newly constructed parser may
     * then be configured by means of its <code>DOMConfiguration
     * object, and used to parse documents by means of its <code>parse
     *  method.
     * @param mode  The <code>mode argument is either
     *   <code>MODE_SYNCHRONOUS or MODE_ASYNCHRONOUS, if
     *   <code>mode is MODE_SYNCHRONOUS then the
     *   <code>LSParser that is created will operate in synchronous
     *   mode, if it's <code>MODE_ASYNCHRONOUS then the
     *   <code>LSParser that is created will operate in asynchronous
     *   mode.
     * @param schemaType  An absolute URI representing the type of the schema
     *   language used during the load of a <code>Document using the
     *   newly created <code>LSParser. Note that no lexical checking
     *   is done on the absolute URI. In order to create a
     *   <code>LSParser for any kind of schema types (i.e. the
     *   LSParser will be free to use any schema found), use the value
     *   <code>null.
     * <p >Note:    For W3C XML Schema [XML Schema Part 1]
     *   , applications must use the value
     *   <code>"http://www.w3.org/2001/XMLSchema". For XML DTD [XML 1.0],
     *   applications must use the value
     *   <code>"http://www.w3.org/TR/REC-xml". Other Schema languages
     *   are outside the scope of the W3C and therefore should recommend an
     *   absolute URI in order to use this method.
     * @return  The newly created <code>LSParser object. This
     *   <code>LSParser is either synchronous or asynchronous
     *   depending on the value of the <code>mode argument.
     * <p >Note:    By default, the newly created LSParser
     *   does not contain a <code>DOMErrorHandler, i.e. the value of
     *   the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
     *   error-handler</a>" configuration parameter is null. However, implementations
     *   may provide a default error handler at creation time. In that case,
     *   the initial value of the <code>"error-handler" configuration
     *   parameter on the new <code>LSParser object contains a
     *   reference to the default error handler.
     * @exception DOMException
     *    NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
     *   not supported.
     */
    public LSParser createLSParser(short mode,
                                   String schemaType)
                                   throws DOMException;

    /**
     *  Create a new <code>LSSerializer object.
     * @return The newly created <code>LSSerializer object.
     * <p >Note:    By default, the newly created
     *   <code>LSSerializer has no DOMErrorHandler, i.e.
     *   the value of the <code>"error-handler" configuration
     *   parameter is <code>null. However, implementations may
     *   provide a default error handler at creation time. In that case, the
     *   initial value of the <code>"error-handler" configuration
     *   parameter on the new <code>LSSerializer object contains a
     *   reference to the default error handler.
     */
    public LSSerializer createLSSerializer();

    /**
     *  Create a new empty input source object where
     * <code>LSInput.characterStream, LSInput.byteStream
     * , <code>LSInput.stringData LSInput.systemId,
     * <code>LSInput.publicId, LSInput.baseURI, and
     * <code>LSInput.encoding are null, and
     * <code>LSInput.certifiedText is false.
     * @return  The newly created input object.
     */
    public LSInput createLSInput();

    /**
     *  Create a new empty output destination object where
     * <code>LSOutput.characterStream,
     * <code>LSOutput.byteStream, LSOutput.systemId,
     * <code>LSOutput.encoding are null.
     * @return  The newly created output object.
     */
    public LSOutput createLSOutput();

}

Other Java examples (source code examples)

Here is a short list of links related to this Java DOMImplementationLS.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.