dominputimpl.java
来自「JAVA 所有包」· Java 代码 · 共 389 行 · 第 1/2 页
JAVA
389 行
/* * Copyright 2001, 2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.sun.org.apache.xerces.internal.dom;import org.w3c.dom.ls.LSInput;import java.io.Reader;import java.io.InputStream;/** * This Class <code>DOMInputImpl</code> represents a single input source for an XML entity. * <p> This Class allows an application to encapsulate information about * an input source in a single object, which may include a public * identifier, a system identifier, a byte stream (possibly with a specified * encoding), and/or a character stream. * <p> The exact definitions of a byte stream and a character stream are * binding dependent. * <p> There are two places that the application will deliver this input * source to the parser: as the argument to the <code>parse</code> method, * or as the return value of the <code>DOMResourceResolver.resolveEntity</code> * method. * <p> The <code>DOMParser</code> will use the <code>LSInput</code> * object to determine how to read XML input. If there is a character stream * available, the parser will read that stream directly; if not, the parser * will use a byte stream, if available; if neither a character stream nor a * byte stream is available, the parser will attempt to open a URI * connection to the resource identified by the system identifier. * <p> An <code>LSInput</code> object belongs to the application: the * parser shall never modify it in any way (it may modify a copy if * necessary). Eventhough all attributes in this interface are writable the * DOM implementation is expected to never mutate a LSInput. * <p>See also the <a href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Loadand Save Specification</a>. * * @xerces.internal * * @author Gopal Sharma, SUN Microsystems Inc. * @version $Id: DOMInputImpl.java,v 1.2.6.1 2005/08/30 13:20:42 sunithareddy Exp $ */// REVISIT:// 1. it should be possible to do the following// DOMInputImpl extends XMLInputSource implements LSInput// 2. we probably need only the default constructor. -- elpublic class DOMInputImpl implements LSInput { // // Data // protected String fPublicId = null; protected String fSystemId = null; protected String fBaseSystemId = null; protected InputStream fByteStream = null; protected Reader fCharStream = null; protected String fData = null; protected String fEncoding = null; protected boolean fCertifiedText = false; /** * Default Constructor, constructs an input source * * */ public DOMInputImpl() {} /** * Constructs an input source from just the public and system * identifiers, leaving resolution of the entity and opening of * the input stream up to the caller. * * @param publicId The public identifier, if known. * @param systemId The system identifier. This value should * always be set, if possible, and can be * relative or absolute. If the system identifier * is relative, then the base system identifier * should be set. * @param baseSystemId The base system identifier. This value should * always be set to the fully expanded URI of the * base system identifier, if possible. */ public DOMInputImpl(String publicId, String systemId, String baseSystemId) { fPublicId = publicId; fSystemId = systemId; fBaseSystemId = baseSystemId; } // DOMInputImpl(String,String,String) /** * Constructs an input source from a byte stream. * * @param publicId The public identifier, if known. * @param systemId The system identifier. This value should * always be set, if possible, and can be * relative or absolute. If the system identifier * is relative, then the base system identifier * should be set. * @param baseSystemId The base system identifier. This value should * always be set to the fully expanded URI of the * base system identifier, if possible. * @param byteStream The byte stream. * @param encoding The encoding of the byte stream, if known. */ public DOMInputImpl(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding) { fPublicId = publicId; fSystemId = systemId; fBaseSystemId = baseSystemId; fByteStream = byteStream; fEncoding = encoding; } // DOMInputImpl(String,String,String,InputStream,String) /** * Constructs an input source from a character stream. * * @param publicId The public identifier, if known. * @param systemId The system identifier. This value should * always be set, if possible, and can be * relative or absolute. If the system identifier * is relative, then the base system identifier * should be set. * @param baseSystemId The base system identifier. This value should * always be set to the fully expanded URI of the * base system identifier, if possible. * @param charStream The character stream. * @param encoding The original encoding of the byte stream * used by the reader, if known. */ public DOMInputImpl(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding) { fPublicId = publicId; fSystemId = systemId; fBaseSystemId = baseSystemId; fCharStream = charStream; fEncoding = encoding; } // DOMInputImpl(String,String,String,Reader,String) /** * Constructs an input source from a String. * * @param publicId The public identifier, if known. * @param systemId The system identifier. This value should * always be set, if possible, and can be * relative or absolute. If the system identifier * is relative, then the base system identifier * should be set. * @param baseSystemId The base system identifier. This value should * always be set to the fully expanded URI of the * base system identifier, if possible. * @param data The String Data. * @param encoding The original encoding of the byte stream * used by the reader, if known. */ public DOMInputImpl(String publicId, String systemId, String baseSystemId, String data, String encoding) { fPublicId = publicId; fSystemId = systemId; fBaseSystemId = baseSystemId; fData = data; fEncoding = encoding; } // DOMInputImpl(String,String,String,String,String) /** * An attribute of a language-binding dependent type that represents a
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?