📄 inputsource.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Wed Oct 31 22:26:27 PST 2001 --><TITLE>Java API for XML Processing Specification 1.1: Class InputSource</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InputSource.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xml/sax/HandlerBase.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="InputSource.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.xml.sax</FONT><BR>Class InputSource</H2><PRE>java.lang.Object | +--<B>org.xml.sax.InputSource</B></PRE><HR><DL><DT>public class <B>InputSource</B><DT>extends java.lang.Object</DL><P>A single input source for an XML entity. <blockquote> <em>This module, both source code and documentation, is in the Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> </blockquote> <p>This class allows a SAX 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> <p>There are two places that the application will deliver this input source to the parser: as the argument to the Parser.parse method, or as the return value of the EntityResolver.resolveEntity method.</p> <p>The SAX parser will use the InputSource 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> <p>An InputSource object belongs to the application: the SAX parser shall never modify it in any way (it may modify a copy if necessary).</p><P><DL><DT><B>Since: </B><DD>SAX 1.0</DD><DT><B>Version: </B><DD>2.0r2pre</DD><DT><B>Author: </B><DD>David Megginson, <a href="mailto:sax@megginson.com">sax@megginson.com</a></DD><DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/Parser.html#parse(org.xml.sax.InputSource)"><CODE>Parser.parse(org.xml.sax.InputSource)</CODE></A>, <A HREF="../../../org/xml/sax/EntityResolver.html#resolveEntity(java.lang.String, java.lang.String)"><CODE>EntityResolver.resolveEntity(java.lang.String, java.lang.String)</CODE></A>, <CODE>InputStream</CODE>, <CODE>Reader</CODE></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#InputSource()">InputSource</A></B>()</CODE><BR> Zero-argument default constructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#InputSource(java.io.InputStream)">InputSource</A></B>(java.io.InputStream byteStream)</CODE><BR> Create a new input source with a byte stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#InputSource(java.io.Reader)">InputSource</A></B>(java.io.Reader characterStream)</CODE><BR> Create a new input source with a character stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#InputSource(java.lang.String)">InputSource</A></B>(java.lang.String systemId)</CODE><BR> Create a new input source with a system identifier.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.io.InputStream</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#getByteStream()">getByteStream</A></B>()</CODE><BR> Get the byte stream for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.io.Reader</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#getCharacterStream()">getCharacterStream</A></B>()</CODE><BR> Get the character stream for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#getEncoding()">getEncoding</A></B>()</CODE><BR> Get the character encoding for a byte stream or URI.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#getPublicId()">getPublicId</A></B>()</CODE><BR> Get the public identifier for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#getSystemId()">getSystemId</A></B>()</CODE><BR> Get the system identifier for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#setByteStream(java.io.InputStream)">setByteStream</A></B>(java.io.InputStream byteStream)</CODE><BR> Set the byte stream for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#setCharacterStream(java.io.Reader)">setCharacterStream</A></B>(java.io.Reader characterStream)</CODE><BR> Set the character stream for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#setEncoding(java.lang.String)">setEncoding</A></B>(java.lang.String encoding)</CODE><BR> Set the character encoding, if known.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#setPublicId(java.lang.String)">setPublicId</A></B>(java.lang.String publicId)</CODE><BR> Set the public identifier for this input source.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/xml/sax/InputSource.html#setSystemId(java.lang.String)">setSystemId</A></B>(java.lang.String systemId)</CODE><BR> Set the system identifier for this input source.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="InputSource()"><!-- --></A><H3>InputSource</H3><PRE>public <B>InputSource</B>()</PRE><DL><DD>Zero-argument default constructor.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#setPublicId(java.lang.String)"><CODE>setPublicId(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setSystemId(java.lang.String)"><CODE>setSystemId(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setByteStream(java.io.InputStream)"><CODE>setByteStream(java.io.InputStream)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setCharacterStream(java.io.Reader)"><CODE>setCharacterStream(java.io.Reader)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setEncoding(java.lang.String)"><CODE>setEncoding(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="InputSource(java.lang.String)"><!-- --></A><H3>InputSource</H3><PRE>public <B>InputSource</B>(java.lang.String systemId)</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -