📄 inputsource.html
字号:
<DL><DD>Create a new input source with a system identifier. <p>Applications may use setPublicId to include a public identifier as well, or setEncoding to specify the character encoding, if known.</p> <p>If the system identifier is a URL, it must be full resolved.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>systemId</CODE> - The system identifier (URI).<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#setEncoding(java.lang.String)"><CODE>setEncoding(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setCharacterStream(java.io.Reader)"><CODE>setCharacterStream(java.io.Reader)</CODE></A></DL></DD></DL><HR><A NAME="InputSource(java.io.InputStream)"><!-- --></A><H3>InputSource</H3><PRE>public <B>InputSource</B>(java.io.InputStream byteStream)</PRE><DL><DD>Create a new input source with a byte stream. <p>Application writers may use setSystemId to provide a base for resolving relative URIs, setPublicId to include a public identifier, and/or setEncoding to specify the object's character encoding.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>byteStream</CODE> - The raw byte stream containing the document.<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#setEncoding(java.lang.String)"><CODE>setEncoding(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></DL></DD></DL><HR><A NAME="InputSource(java.io.Reader)"><!-- --></A><H3>InputSource</H3><PRE>public <B>InputSource</B>(java.io.Reader characterStream)</PRE><DL><DD>Create a new input source with a character stream. <p>Application writers may use setSystemId() to provide a base for resolving relative URIs, and setPublicId to include a public identifier.</p> <p>The character stream shall not include a byte order mark.</p><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></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setPublicId(java.lang.String)"><!-- --></A><H3>setPublicId</H3><PRE>public void <B>setPublicId</B>(java.lang.String publicId)</PRE><DL><DD>Set the public identifier for this input source. <p>The public identifier is always optional: if the application writer includes one, it will be provided as part of the location information.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>publicId</CODE> - The public identifier as a string.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#getPublicId()"><CODE>getPublicId()</CODE></A>, <A HREF="../../../org/xml/sax/Locator.html#getPublicId()"><CODE>Locator.getPublicId()</CODE></A>, <A HREF="../../../org/xml/sax/SAXParseException.html#getPublicId()"><CODE>SAXParseException.getPublicId()</CODE></A></DL></DD></DL><HR><A NAME="getPublicId()"><!-- --></A><H3>getPublicId</H3><PRE>public java.lang.String <B>getPublicId</B>()</PRE><DL><DD>Get the public identifier for this input source.<DD><DL><DT><B>Returns:</B><DD>The public identifier, or null if none was supplied.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#setPublicId(java.lang.String)"><CODE>setPublicId(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="setSystemId(java.lang.String)"><!-- --></A><H3>setSystemId</H3><PRE>public void <B>setSystemId</B>(java.lang.String systemId)</PRE><DL><DD>Set the system identifier for this input source. <p>The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a connection to the URI only if there is no byte stream or character stream specified).</p> <p>If the application knows the character encoding of the object pointed to by the system identifier, it can register the encoding using the setEncoding method.</p> <p>If the system ID is a URL, it must be fully resolved.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>systemId</CODE> - The system identifier as a string.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#setEncoding(java.lang.String)"><CODE>setEncoding(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#getSystemId()"><CODE>getSystemId()</CODE></A>, <A HREF="../../../org/xml/sax/Locator.html#getSystemId()"><CODE>Locator.getSystemId()</CODE></A>, <A HREF="../../../org/xml/sax/SAXParseException.html#getSystemId()"><CODE>SAXParseException.getSystemId()</CODE></A></DL></DD></DL><HR><A NAME="getSystemId()"><!-- --></A><H3>getSystemId</H3><PRE>public java.lang.String <B>getSystemId</B>()</PRE><DL><DD>Get the system identifier for this input source. <p>The getEncoding method will return the character encoding of the object pointed to, or null if unknown.</p> <p>If the system ID is a URL, it will be fully resolved.</p><DD><DL><DT><B>Returns:</B><DD>The system identifier, or null if none was supplied.<DT><B>See Also: </B><DD><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#getEncoding()"><CODE>getEncoding()</CODE></A></DL></DD></DL><HR><A NAME="setByteStream(java.io.InputStream)"><!-- --></A><H3>setByteStream</H3><PRE>public void <B>setByteStream</B>(java.io.InputStream byteStream)</PRE><DL><DD>Set the byte stream for this input source. <p>The SAX parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself.</p> <p>If the application knows the character encoding of the byte stream, it should set it with the setEncoding method.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>byteStream</CODE> - A byte stream containing an XML document or other entity.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#setEncoding(java.lang.String)"><CODE>setEncoding(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#getByteStream()"><CODE>getByteStream()</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#getEncoding()"><CODE>getEncoding()</CODE></A>, <CODE>InputStream</CODE></DL></DD></DL><HR><A NAME="getByteStream()"><!-- --></A><H3>getByteStream</H3><PRE>public java.io.InputStream <B>getByteStream</B>()</PRE><DL><DD>Get the byte stream for this input source. <p>The getEncoding method will return the character encoding for this byte stream, or null if unknown.</p><DD><DL><DT><B>Returns:</B><DD>The byte stream, or null if none was supplied.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#getEncoding()"><CODE>getEncoding()</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#setByteStream(java.io.InputStream)"><CODE>setByteStream(java.io.InputStream)</CODE></A></DL></DD></DL><HR><A NAME="setEncoding(java.lang.String)"><!-- --></A><H3>setEncoding</H3><PRE>public void <B>setEncoding</B>(java.lang.String encoding)</PRE><DL><DD>Set the character encoding, if known. <p>The encoding must be a string acceptable for an XML encoding declaration (see section 4.3.3 of the XML 1.0 recommendation).</p> <p>This method has no effect when the application provides a character stream.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>encoding</CODE> - A string describing the character encoding.<DT><B>See Also: </B><DD><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#getEncoding()"><CODE>getEncoding()</CODE></A></DL></DD></DL><HR><A NAME="getEncoding()"><!-- --></A><H3>getEncoding</H3><PRE>public java.lang.String <B>getEncoding</B>()</PRE><DL><DD>Get the character encoding for a byte stream or URI.<DD><DL><DT><B>Returns:</B><DD>The encoding, or null if none was supplied.<DT><B>See Also: </B><DD><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#getSystemId()"><CODE>getSystemId()</CODE></A>, <A HREF="../../../org/xml/sax/InputSource.html#getByteStream()"><CODE>getByteStream()</CODE></A></DL></DD></DL><HR><A NAME="setCharacterStream(java.io.Reader)"><!-- --></A><H3>setCharacterStream</H3><PRE>public void <B>setCharacterStream</B>(java.io.Reader characterStream)</PRE><DL><DD>Set the character stream for this input source. <p>If there is a character stream specified, the SAX parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>characterStream</CODE> - The character stream containing the XML document or other entity.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#getCharacterStream()"><CODE>getCharacterStream()</CODE></A>, <CODE>Reader</CODE></DL></DD></DL><HR><A NAME="getCharacterStream()"><!-- --></A><H3>getCharacterStream</H3><PRE>public java.io.Reader <B>getCharacterStream</B>()</PRE><DL><DD>Get the character stream for this input source.<DD><DL><DT><B>Returns:</B><DD>The character stream, or null if none was supplied.<DT><B>See Also: </B><DD><A HREF="../../../org/xml/sax/InputSource.html#setCharacterStream(java.io.Reader)"><CODE>setCharacterStream(java.io.Reader)</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -