jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
author joehw
Thu, 28 Jul 2016 22:58:41 -0700
changeset 39907 db51759e3695
parent 39080 57563e513b11
child 44797 8b3b3b911b8a
permissions -rw-r--r--
8158084: Catalog API: JAXP XML Processor Support Reviewed-by: lancea, clanger
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 2000-2002,2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *      http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
package com.sun.org.apache.xerces.internal.xni.parser;
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
import java.io.InputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import java.io.Reader;
39907
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
    26
import org.xml.sax.InputSource;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * This class represents an input source for an XML document. The
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 * basic properties of an input source are the following:
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 *  <li>public identifier</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 *  <li>system identifier</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 *  <li>byte stream or character stream</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 *  <li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * @author Andy Clark, IBM
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
public class XMLInputSource {
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
    // Data
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
    /** Public identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
    protected String fPublicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
    /** System identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
    protected String fSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
    /** Base system identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
    protected String fBaseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    /** Byte stream. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    protected InputStream fByteStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
    /** Character stream. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    protected Reader fCharStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
    /** Encoding. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    protected String fEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
39080
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    65
    //indicates whether the source is created by a resolver
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    66
    boolean fIsCreatedByResolver = false;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    // Constructors
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * Constructs an input source from just the public and system
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * identifiers, leaving resolution of the entity and opening of
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * the input stream up to the caller.
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * @param publicId     The public identifier, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     * @param systemId     The system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     *                     always be set, if possible, and can be
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     *                     relative or absolute. If the system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     *                     is relative, then the base system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     *                     should be set.
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * @param baseSystemId The base system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     *                     always be set to the fully expanded URI of the
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     *                     base system identifier, if possible.
39080
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    85
     * @param isCreatedByResolver a flag to indicate whether the source is
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    86
     * created by a resolver
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
    public XMLInputSource(String publicId, String systemId,
39080
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    89
                          String baseSystemId, boolean isCreatedByResolver) {
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
        fPublicId = publicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
        fSystemId = systemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
        fBaseSystemId = baseSystemId;
39080
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
    93
        fIsCreatedByResolver = isCreatedByResolver;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    } // <init>(String,String,String)
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     * Constructs an input source from a XMLResourceIdentifier
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     * object, leaving resolution of the entity and opening of
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * the input stream up to the caller.
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * @param resourceIdentifier    the XMLResourceIdentifier containing the information
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
    public XMLInputSource(XMLResourceIdentifier resourceIdentifier) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
        fPublicId = resourceIdentifier.getPublicId();
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
        fSystemId = resourceIdentifier.getLiteralSystemId();
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
        fBaseSystemId = resourceIdentifier.getBaseSystemId();
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
    } // <init>(XMLResourceIdentifier)
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
    /**
39907
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   111
     * Constructs an input source from a SAX InputSource
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   112
     * object.
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   113
     *
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   114
     * @param inputSource  a SAX InputSource
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   115
     * @param isCreatedByResolver a flag to indicate whether the source is
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   116
     * created by a resolver
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   117
     */
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   118
    public XMLInputSource(InputSource inputSource, boolean isCreatedByResolver) {
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   119
        fPublicId = inputSource.getPublicId();
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   120
        fSystemId = inputSource.getSystemId();
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   121
        fByteStream = inputSource.getByteStream();
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   122
        fCharStream = inputSource.getCharacterStream();
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   123
        fEncoding = inputSource.getEncoding();
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   124
        fIsCreatedByResolver = isCreatedByResolver;
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   125
    }
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   126
db51759e3695 8158084: Catalog API: JAXP XML Processor Support
joehw
parents: 39080
diff changeset
   127
    /**
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     * Constructs an input source from a byte stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     * @param publicId     The public identifier, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * @param systemId     The system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     *                     always be set, if possible, and can be
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     *                     relative or absolute. If the system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     *                     is relative, then the base system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     *                     should be set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * @param baseSystemId The base system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     *                     always be set to the fully expanded URI of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     *                     base system identifier, if possible.
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * @param byteStream   The byte stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     * @param encoding     The encoding of the byte stream, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    public XMLInputSource(String publicId, String systemId,
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
                          String baseSystemId, InputStream byteStream,
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
                          String encoding) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
        fPublicId = publicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
        fSystemId = systemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
        fBaseSystemId = baseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
        fByteStream = byteStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
        fEncoding = encoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
    } // <init>(String,String,String,InputStream,String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * Constructs an input source from a character stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
     * @param publicId     The public identifier, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     * @param systemId     The system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     *                     always be set, if possible, and can be
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     *                     relative or absolute. If the system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     *                     is relative, then the base system identifier
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     *                     should be set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * @param baseSystemId The base system identifier. This value should
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     *                     always be set to the fully expanded URI of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     *                     base system identifier, if possible.
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     * @param charStream   The character stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     * @param encoding     The original encoding of the byte stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
     *                     used by the reader, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
    public XMLInputSource(String publicId, String systemId,
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
                          String baseSystemId, Reader charStream,
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
                          String encoding) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
        fPublicId = publicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
        fSystemId = systemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
        fBaseSystemId = baseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
        fCharStream = charStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
        fEncoding = encoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
    } // <init>(String,String,String,Reader,String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
    // Public methods
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     * Sets the public identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     * @param publicId The new public identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
    public void setPublicId(String publicId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
        fPublicId = publicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
    } // setPublicId(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
    /** Returns the public identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
    public String getPublicId() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
        return fPublicId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
    } // getPublicId():String
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
     * Sets the system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     * @param systemId The new system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
    public void setSystemId(String systemId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
        fSystemId = systemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
    } // setSystemId(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
    /** Returns the system identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
    public String getSystemId() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
        return fSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
    } // getSystemId():String
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     * Sets the base system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
     * @param baseSystemId The new base system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
    public void setBaseSystemId(String baseSystemId) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
        fBaseSystemId = baseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
    } // setBaseSystemId(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
    /** Returns the base system identifier. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
    public String getBaseSystemId() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
        return fBaseSystemId;
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
    } // getBaseSystemId():String
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
     * Sets the byte stream. If the byte stream is not already opened
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
     * when this object is instantiated, then the code that opens the
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
     * stream should also set the byte stream on this object. Also, if
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
     * the encoding is auto-detected, then the encoding should also be
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
     * set on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
     * @param byteStream The new byte stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
    public void setByteStream(InputStream byteStream) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
        fByteStream = byteStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
    } // setByteStream(InputSource)
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
    /** Returns the byte stream. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
    public InputStream getByteStream() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
        return fByteStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
    } // getByteStream():InputStream
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
     * Sets the character stream. If the character stream is not already
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
     * opened when this object is instantiated, then the code that opens
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
     * the stream should also set the character stream on this object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
     * Also, the encoding of the byte stream used by the reader should
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
     * also be set on this object, if known.
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
     * @param charStream The new character stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
     * @see #setEncoding
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
    public void setCharacterStream(Reader charStream) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
        fCharStream = charStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
    } // setCharacterStream(Reader)
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
    /** Returns the character stream. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
    public Reader getCharacterStream() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
        return fCharStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
    } // getCharacterStream():Reader
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
     * Sets the encoding of the stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
     * @param encoding The new encoding.
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
    public void setEncoding(String encoding) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
        fEncoding = encoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
    } // setEncoding(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
    /** Returns the encoding of the stream, or null if not known. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
    public String getEncoding() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
        return fEncoding;
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
    } // getEncoding():String
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
39080
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   276
    /**
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   277
     * Sets the flag to indicate whether this source is created by a resolver
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   278
     * @param createdByResolver the flag
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   279
     */
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   280
    public void setCreatedByResolver(boolean createdByResolver) {
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   281
        fIsCreatedByResolver = createdByResolver;
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   282
    }
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   283
    /**
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   284
     * Returns a boolean to indicate whether this source is created by a resolver.
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   285
     * @return true if the source is created by a resolver, false otherwise
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   286
     */
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   287
    public boolean isCreatedByResolver() {
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   288
        return fIsCreatedByResolver;
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   289
    }
57563e513b11 8158204: accessExternalSchema property handling is inconsistent and differs from spec.
joehw
parents: 25868
diff changeset
   290
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
} // class XMLInputSource