< prev index next >

src/java.xml/share/classes/org/xml/sax/InputSource.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 // SAX input source.
  27 // http://www.saxproject.org
  28 // No warranty; no copyright -- use this as you will.
  29 // $Id: InputSource.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
  30 
  31 package org.xml.sax;
  32 
  33 import java.io.IOException;
  34 import java.io.Reader;
  35 import java.io.InputStream;
  36 
  37 /**
  38  * A single input source for an XML entity.
  39  *
  40  * <blockquote>
  41  * <em>This module, both source code and documentation, is in the
  42  * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
  43  * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
  44  * for further information.
  45  * </blockquote>
  46  *
  47  * <p>This class allows a SAX application to encapsulate information
  48  * about an input source in a single object, which may include
  49  * a public identifier, a system identifier, a byte stream (possibly
  50  * with a specified encoding), and/or a character stream.</p>
  51  *
  52  * <p>There are two places that the application can deliver an
  53  * input source to the parser: as the argument to the Parser.parse
  54  * method, or as the return value of the EntityResolver.resolveEntity
  55  * method.</p>
  56  *
  57  * <p>The SAX parser will use the InputSource object to determine how
  58  * to read XML input.  If there is a character stream available, the
  59  * parser will read that stream directly, disregarding any text
  60  * encoding declaration found in that stream.
  61  * If there is no character stream, but there is
  62  * a byte stream, the parser will use that byte stream, using the
  63  * encoding specified in the InputSource or else (if no encoding is
  64  * specified) autodetecting the character encoding using an algorithm
  65  * such as the one in the XML specification.  If neither a character


   1 /*
   2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 





  26 package org.xml.sax;
  27 
  28 import java.io.IOException;
  29 import java.io.Reader;
  30 import java.io.InputStream;
  31 
  32 /**
  33  * A single input source for an XML entity.







  34  *
  35  * <p>This class allows a SAX application to encapsulate information
  36  * about an input source in a single object, which may include
  37  * a public identifier, a system identifier, a byte stream (possibly
  38  * with a specified encoding), and/or a character stream.</p>
  39  *
  40  * <p>There are two places that the application can deliver an
  41  * input source to the parser: as the argument to the Parser.parse
  42  * method, or as the return value of the EntityResolver.resolveEntity
  43  * method.</p>
  44  *
  45  * <p>The SAX parser will use the InputSource object to determine how
  46  * to read XML input.  If there is a character stream available, the
  47  * parser will read that stream directly, disregarding any text
  48  * encoding declaration found in that stream.
  49  * If there is no character stream, but there is
  50  * a byte stream, the parser will use that byte stream, using the
  51  * encoding specified in the InputSource or else (if no encoding is
  52  * specified) autodetecting the character encoding using an algorithm
  53  * such as the one in the XML specification.  If neither a character


< prev index next >